Trait Dispatch

Source
pub trait Dispatch {
    type Tx: WireTx;

    // Required methods
    fn min_key_len(&self) -> VarKeyKind;
    async fn handle(
        &mut self,
        tx: &Sender<Self::Tx>,
        hdr: &VarHeader,
        body: &[u8],
    ) -> Result<(), <Self::Tx as WireTx>::Error>;
}
Expand description

The dispatch trait handles an incoming endpoint or topic message

The implementations of this trait are typically implemented by the define_dispatch! macro.

Required Associated Types§

Source

type Tx: WireTx

The WireTx impl used by this dispatcher

Required Methods§

Source

fn min_key_len(&self) -> VarKeyKind

The minimum key length required to avoid hash collisions

Source

async fn handle( &mut self, tx: &Sender<Self::Tx>, hdr: &VarHeader, body: &[u8], ) -> Result<(), <Self::Tx as WireTx>::Error>

Handle a single incoming frame (endpoint or topic), and dispatch appropriately

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§