Trait DispatchServerMessage

pub trait DispatchServerMessage<H, T = Channel>: Sized + 'static
where T: Transport,
{ // Required methods fn on_one_way( handler: &mut H, server: &ServerSender<Self, T>, ordinal: u64, buffer: <T as Transport>::RecvBuffer, ) -> impl Future<Output = ()> + Send; fn on_two_way( handler: &mut H, server: &ServerSender<Self, T>, ordinal: u64, buffer: <T as Transport>::RecvBuffer, responder: Responder, ) -> impl Future<Output = ()> + Send; }
Expand description

A protocol which dispatches incoming server messages to a handler.

Required Methods§

fn on_one_way( handler: &mut H, server: &ServerSender<Self, T>, ordinal: u64, buffer: <T as Transport>::RecvBuffer, ) -> impl Future<Output = ()> + Send

Handles a received server one-way message with the given handler.

fn on_two_way( handler: &mut H, server: &ServerSender<Self, T>, ordinal: u64, buffer: <T as Transport>::RecvBuffer, responder: Responder, ) -> impl Future<Output = ()> + Send

Handles a received server two-way message with the given handler.

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§