Trait Handler

Source
pub trait Handler {
    // Required method
    fn call(
        &self,
        req: Request<Body>,
        params: OwnedCaptures,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn StdError + Send + Sync>>> + Send + 'static>>;
}

Required Methods§

Source

fn call( &self, req: Request<Body>, params: OwnedCaptures, ) -> Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn StdError + Send + Sync>>> + Send + 'static>>

Trait Implementations§

Source§

impl Handler for Box<dyn Handler + Send + Sync>

Source§

fn call( &self, req: Request<Body>, params: OwnedCaptures, ) -> Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn StdError + Send + Sync>>> + Send + 'static>>

Implementations on Foreign Types§

Source§

impl Handler for Box<dyn Handler + Send + Sync>

Source§

fn call( &self, req: Request<Body>, params: OwnedCaptures, ) -> Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn StdError + Send + Sync>>> + Send + 'static>>

Implementors§

Source§

impl<F, E, Fut> Handler for F
where F: Fn(Request<Body>, OwnedCaptures) -> Fut, E: StdError + Send + Sync + 'static, Fut: Future<Output = Result<Response<Body>, E>> + Send + 'static,