pub trait ServerHandler<T: Transport> {
// Required methods
fn on_event(&mut self, ordinal: u64, buffer: T::RecvBuffer);
fn on_transaction(
&mut self,
ordinal: u64,
buffer: T::RecvBuffer,
responder: Responder,
);
}
Expand description
A type which handles incoming events for a server.
Required Methods§
Sourcefn on_event(&mut self, ordinal: u64, buffer: T::RecvBuffer)
fn on_event(&mut self, ordinal: u64, buffer: T::RecvBuffer)
Handles a received server event.
The dispatcher cannot handle more messages until on_event
completes. If on_event
may
block, perform asynchronous work, or take a long time to process a message, it should
offload work to an async task.
Sourcefn on_transaction(
&mut self,
ordinal: u64,
buffer: T::RecvBuffer,
responder: Responder,
)
fn on_transaction( &mut self, ordinal: u64, buffer: T::RecvBuffer, responder: Responder, )
Handles a received server transaction.
The dispatcher cannot handle more messages until on_event
completes. If on_event
may
block, perform asynchronous work, or take a long time to process a message, it should
offload work to an async task.