[][src]Trait tide::Middleware

pub trait Middleware<State>: 'static + Send + Sync {
    fn handle<'a>(
        &'a self,
        cx: Request<State>,
        next: Next<'a, State>
    ) -> Pin<Box<dyn Future<Output = Response> + Send + 'a>>; }

Middleware that wraps around remaining middleware chain.

Required methods

fn handle<'a>(
    &'a self,
    cx: Request<State>,
    next: Next<'a, State>
) -> Pin<Box<dyn Future<Output = Response> + Send + 'a>>

Asynchronously handle the request, and return a response.

Loading content...

Implementors

impl<State, F> Middleware<State> for F where
    F: Send + Sync + 'static + for<'a> Fn(Request<State>, Next<'a, State>) -> Pin<Box<dyn Future<Output = Response> + Send + 'a>>, 
[src]

impl<State: Send + Sync + 'static> Middleware<State> for Cors[src]

impl<State: Send + Sync + 'static> Middleware<State> for RequestLogger[src]

Loading content...