Trait DispatchServerMessage

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

A protocol which dispatches incoming server messages to a handler.

Required Methods§

Source

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

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

Source

fn on_two_way( handler: &mut H, server: &ServerSender<Self, T>, ordinal: u64, buffer: T::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§