Skip to main content

LocalServerHandler

Trait LocalServerHandler 

Source
pub trait LocalServerHandler<T: Transport> {
    // Required methods
    fn on_one_way(
        &mut self,
        message: Message<T>,
    ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>>;
    fn on_two_way(
        &mut self,
        message: Message<T>,
        responder: Responder<T>,
    ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>>;
}
Expand description

A type which handles incoming events for a local server.

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

Required Methods§

Source

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

Handles a received one-way server message.

See ServerHandler::on_one_way for more information.

Source

fn on_two_way( &mut self, message: Message<T>, responder: Responder<T>, ) -> impl Future<Output = Result<(), ProtocolError<T::Error>>>

Handles a received two-way server message.

See ServerHandler::on_two_way for more information.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§