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§
Required Methods§
Sourcefn min_key_len(&self) -> VarKeyKind
fn min_key_len(&self) -> VarKeyKind
The minimum key length required to avoid hash collisions
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.