Skip to main content

DispatchLocalServerMessage

Trait DispatchLocalServerMessage 

Source
pub trait DispatchLocalServerMessage<H, T: Transport>: Sized + 'static {
    // Required methods
    fn on_one_way(
        handler: &mut H,
        ordinal: u64,
        flexibility: Flexibility,
        body: Body<T>,
    ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>>;
    fn on_two_way(
        handler: &mut H,
        ordinal: u64,
        flexibility: Flexibility,
        body: Body<T>,
        responder: Responder<T>,
    ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>>;
}
Expand description

A protocol which dispatches incoming server messages to a local handler.

This is a variant of DispatchServerMessage that does not require implementing Send and only supports local-thread executors.

Required Methods§

Source

fn on_one_way( handler: &mut H, ordinal: u64, flexibility: Flexibility, body: Body<T>, ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>>

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

Source

fn on_two_way( handler: &mut H, ordinal: u64, flexibility: Flexibility, body: Body<T>, responder: Responder<T>, ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>>

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§