pub trait ClientHandler<T: Transport> {
// Required method
fn on_event(
&mut self,
sender: &ClientSender<T>,
ordinal: u64,
buffer: T::RecvBuffer,
) -> impl Future<Output = ()> + Send;
}
Expand description
A type which handles incoming events for a client.
Required Methods§
Sourcefn on_event(
&mut self,
sender: &ClientSender<T>,
ordinal: u64,
buffer: T::RecvBuffer,
) -> impl Future<Output = ()> + Send
fn on_event( &mut self, sender: &ClientSender<T>, ordinal: u64, buffer: T::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.