Trait ClientHandler

pub trait ClientHandler<T>
where T: Transport,
{ // Required method fn on_event( &mut self, sender: &ClientSender<T>, ordinal: u64, buffer: <T as Transport>::RecvBuffer, ) -> impl Future<Output = ()> + Send; }
Expand description

A type which handles incoming events for a client.

Required Methods§

fn on_event( &mut self, sender: &ClientSender<T>, ordinal: u64, buffer: <T as Transport>::RecvBuffer, ) -> impl Future<Output = ()> + Send

Handles a received client event.

The client cannot handle more messages until on_event completes. If on_event should handle requests in parallel, it should spawn a new async task and return.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl<P, H, T> ClientHandler<T> for ClientHandlerAdapter<P, H>
where P: DispatchClientMessage<H, T>, T: Transport,

§

impl<T> ClientHandler<T> for IgnoreEvents
where T: Transport,