pub trait Handler<Args>: 'static + DynClone + Send + Sync {
type Output;
fn call<'life0, 'async_trait>(
&'life0 self,
args: Args
) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Composable request handlers.
Required Associated Types
Required Methods
fn call<'life0, 'async_trait>(
&'life0 self,
args: Args
) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
where
'life0: 'async_trait,
Self: 'async_trait,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
Trait Implementations
sourceimpl Handler<Request<Body>> for Box<dyn Handler<Request<Body>, Output = Result<Response<Body>, Error>> + 'static, Global>
impl Handler<Request<Body>> for Box<dyn Handler<Request<Body>, Output = Result<Response<Body>, Error>> + 'static, Global>
type Output = Result<Response<Body>, Error>
fn call<'life0, 'async_trait>(
&'life0 self,
req: Request<Body>
) -> Pin<Box<dyn Future<Output = <Box<dyn Handler<Request<Body>, Output = Result<Response<Body>, Error>> + 'static, Global> as Handler<Request<Body>>>::Output> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
where
'life0: 'async_trait,
Box<dyn Handler<Request<Body>, Output = Result<Response<Body>, Error>> + 'static, Global>: 'async_trait,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
Implementations on Foreign Types
sourceimpl Handler<Request<Body>> for Box<dyn Handler<Request<Body>, Output = Result<Response<Body>, Error>> + 'static, Global>
impl Handler<Request<Body>> for Box<dyn Handler<Request<Body>, Output = Result<Response<Body>, Error>> + 'static, Global>
type Output = Result<Response<Body>, Error>
fn call<'life0, 'async_trait>(
&'life0 self,
req: Request<Body>
) -> Pin<Box<dyn Future<Output = <Box<dyn Handler<Request<Body>, Output = Result<Response<Body>, Error>> + 'static, Global> as Handler<Request<Body>>>::Output> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
where
'life0: 'async_trait,
Box<dyn Handler<Request<Body>, Output = Result<Response<Body>, Error>> + 'static, Global>: 'async_trait,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
sourceimpl Handler<Request<Body>> for Dir
impl Handler<Request<Body>> for Dir
type Output = Result<Response<Body>, Error>
fn call<'life0, 'async_trait>(
&'life0 self,
req: Request<Body>
) -> Pin<Box<dyn Future<Output = <Dir as Handler<Request<Body>>>::Output> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
where
'life0: 'async_trait,
Dir: 'async_trait,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
sourceimpl Handler<Request<Body>> for File
impl Handler<Request<Body>> for File
type Output = Result<Response<Body>, Error>
fn call<'life0, 'async_trait>(
&'life0 self,
req: Request<Body>
) -> Pin<Box<dyn Future<Output = <File as Handler<Request<Body>>>::Output> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
where
'life0: 'async_trait,
File: 'async_trait,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;