[][src]Trait surf::middleware::Middleware

pub trait Middleware<C: HttpClient>: 'static + Send + Sync {
    fn handle<'a>(
        &'a self,
        req: Request,
        client: C,
        next: Next<'a, C>
    ) -> BoxFuture<'a, Result<Response, Exception>>; }

Middleware that wraps around remaining middleware chain.

Required methods

fn handle<'a>(
    &'a self,
    req: Request,
    client: C,
    next: Next<'a, C>
) -> BoxFuture<'a, Result<Response, Exception>>

Asynchronously handle the request, and return a response.

Loading content...

Implementors

impl<F, C: HttpClient> Middleware<C> for F where
    F: Send + Sync + 'static + for<'a> Fn(Request, C, Next<'a, C>) -> BoxFuture<'a, Result<Response, Exception>>, 
[src]

Loading content...