Skip to main content

ClientHandler

Trait ClientHandler 

Source
pub trait ClientHandler<T>: Send
where T: Transport,
{ // Required method fn on_event( &mut self, ordinal: u64, flexibility: Flexibility, body: Body<T>, ) -> impl Future<Output = Result<(), ProtocolError<<T as Transport>::Error>>> + Send; }
Expand description

A type which handles incoming events for a client.

Required Methods§

Source

fn on_event( &mut self, ordinal: u64, flexibility: Flexibility, body: Body<T>, ) -> impl Future<Output = Result<(), ProtocolError<<T as Transport>::Error>>> + Send

Handles a received client event.

The client cannot handle more messages until on_event completes. If on_event may block, or would perform asynchronous work that takes a long time, it should offload work to an 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§