fidl_next::protocol

Trait ServerHandler

Source
pub trait ServerHandler<T: Transport> {
    // Required methods
    fn on_one_way(
        &mut self,
        sender: &ServerSender<T>,
        ordinal: u64,
        buffer: T::RecvBuffer,
    );
    fn on_two_way(
        &mut self,
        sender: &ServerSender<T>,
        ordinal: u64,
        buffer: T::RecvBuffer,
        responder: Responder,
    );
}
Expand description

A type which handles incoming events for a server.

Required Methods§

Source

fn on_one_way( &mut self, sender: &ServerSender<T>, ordinal: u64, buffer: T::RecvBuffer, )

Handles a received one-way server message.

The server cannot handle more messages until on_one_way completes. If on_one_way may block, perform asynchronous work, or take a long time to process a message, it should offload work to an async task.

Source

fn on_two_way( &mut self, sender: &ServerSender<T>, ordinal: u64, buffer: T::RecvBuffer, responder: Responder, )

Handles a received two-way server message.

The server cannot handle more messages until on_two_way completes. If on_two_way may block, perform asynchronous work, or take a long time to process a message, it should offload work to an async task.

Implementors§

Source§

impl<T, P, H> ServerHandler<T> for ServerAdapter<P, H>
where T: Transport, P: ServerProtocol<T, H>,