Trait silent::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;

    // Provided method
    fn match_req<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _req: &'life1 Request
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: '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,

Provided Methods§

source

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

Implementors§

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