Handler

Trait Handler 

Source
pub trait Handler:
    Send
    + Sync
    + 'static {
    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        _req: Request,
    ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, _req: Request, ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementations on Foreign Types§

Source§

impl Handler for Arc<RouteTree>

Source§

fn call<'life0, 'async_trait>( &'life0 self, req: Request, ) -> Pin<Box<dyn Future<Output = SilentResult<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl Handler for HashMap<Method, Arc<dyn Handler>>

Source§

fn call<'life0, 'async_trait>( &'life0 self, req: Request, ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl Handler for Route

Source§

impl Handler for Next

Source§

impl<F, T, Fut> Handler for HandlerWrapper<F>
where Fut: Future<Output = Result<T>> + Send + 'static, F: Fn(Request) -> Fut + Send + Sync + 'static, T: Into<Response>,

为HandlerWrapper实现Handler