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