Skip to main content

Handler

Trait Handler 

Source
pub trait Handler<C>: Send
where C: Connection,
{ type Error: Debug; // Required method async fn handle(&self, connection: &mut C) -> Result<(), Self::Error>; }

Required Associated Types§

Source

type Error: Debug

Required Methods§

Source

async fn handle(&self, connection: &mut C) -> Result<(), Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<H, C> Handler<C> for &H
where C: Connection, H: Handler<C> + Send + Sync,

Source§

type Error = <H as Handler<C>>::Error

Source§

async fn handle(&self, connection: &mut C) -> Result<(), Self::Error>

Implementors§

Source§

impl<M, H, C> Handler<C> for CompositeHandler<M, H>
where M: Middleware<C, H>, H: Handler<C>, C: Connection,

Source§

type Error = <M as Middleware<C, H>>::Error