Skip to main content

WsRouteExt

Trait WsRouteExt 

Source
pub trait WsRouteExt {
    // Required method
    fn ws<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
       where F: Fn(WsSession) -> Fut + Clone + Send + Sync + 'static,
             Fut: Future<Output = ()> + Send + 'static;
}
Expand description

Register WebSocket routes on App / Router.

Required Methods§

Source

fn ws<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
where F: Fn(WsSession) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

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 WsRouteExt for App

Source§

fn ws<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
where F: Fn(WsSession) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Source§

impl WsRouteExt for Router

Source§

fn ws<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
where F: Fn(WsSession) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Implementors§