Skip to main content

DispatchServerMessage

Trait DispatchServerMessage 

Source
pub trait DispatchServerMessage<H, T: Transport>: Sized + 'static {
    // Required methods
    fn on_one_way(
        handler: &mut H,
        message: Message<T>,
    ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>> + Send;
    fn on_two_way(
        handler: &mut H,
        message: Message<T>,
        responder: Responder<T>,
    ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>> + Send;
}
Expand description

A protocol which dispatches incoming server messages to a handler.

Required Methods§

Source

fn on_one_way( handler: &mut H, message: Message<T>, ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>> + Send

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

Source

fn on_two_way( handler: &mut H, message: Message<T>, responder: Responder<T>, ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>> + 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".

Implementors§