Skip to main content

ConnectionHandler

Trait ConnectionHandler 

Source
pub trait ConnectionHandler:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle<'a>(&'a self, connection: Connection) -> HandlerFuture<'a>;
}

Required Methods§

Source

fn handle<'a>(&'a self, connection: Connection) -> HandlerFuture<'a>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F, Fut> ConnectionHandler for F
where F: Fn(Connection) -> Fut + Send + Sync + 'static, Fut: Future<Output = HandlerResult> + Send + 'static,

Available on crate features async or sync only.