via::middleware

Trait Middleware

source
pub trait Middleware<State>: Send + Sync {
    // Required method
    fn call(
        &self,
        request: Request<State>,
        next: Next<State>,
    ) -> BoxFuture<Result<Response>>;
}

Required Methods§

source

fn call( &self, request: Request<State>, next: Next<State>, ) -> BoxFuture<Result<Response>>

Implementors§

source§

impl<State> Middleware<State> for ErrorBoundary
where State: Send + Sync + 'static,

source§

impl<State, F> Middleware<State> for InspectErrorBoundary<F>
where F: Fn(&Error, &State) + Copy + Send + Sync + 'static, State: Send + Sync + 'static,

source§

impl<State, F> Middleware<State> for MapErrorBoundary<F>
where F: Fn(Error, &State) -> Error + Copy + Send + Sync + 'static, State: Send + Sync + 'static,

source§

impl<State, F> Middleware<State> for OrElseErrorBoundary<F>
where F: Fn(Error, &State) -> Result<Response, Error> + Copy + Send + Sync + 'static, State: Send + Sync + 'static,

source§

impl<State, F> Middleware<State> for Timeout<F>
where F: Fn(&State) -> Result<Response, Error> + Copy + Send + Sync + 'static, State: Send + Sync + 'static,

source§

impl<State, T> Middleware<State> for CookieParser<T>
where State: Send + Sync + 'static, T: ParseCookies + Send + Sync,

source§

impl<State, T> Middleware<State> for AllowMethod<T>
where T: Middleware<State>, State: Send + Sync + 'static,

source§

impl<State, T, F> Middleware<State> for T
where T: Fn(Request<State>, Next<State>) -> F + Send + Sync + 'static, F: Future + Send + 'static, F::Output: IntoResponse,