fidl_next::protocol

Trait ServerHandler

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

A type which handles incoming events for a server.

Required Methods§

Source

fn on_event(&mut self, ordinal: u64, buffer: T::RecvBuffer)

Handles a received server event.

The dispatcher cannot handle more messages until on_event completes. If on_event 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_transaction( &mut self, ordinal: u64, buffer: T::RecvBuffer, responder: Responder, )

Handles a received server transaction.

The dispatcher cannot handle more messages until on_event completes. If on_event 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>,