[−][src]Trait vicuna::handler::WrappingHandler
A trait that houses methods related to handlers that can be wrapped with middleware.
Provided methods
fn wrap_with<M: Fn(Handler<E>) -> Handler<E>>(self, middleware: M) -> Handler<E> where
Self: 'static + Fn(Request, Context) -> Result<Response<Body>, E> + Sized,
Self: 'static + Fn(Request, Context) -> Result<Response<Body>, E> + Sized,
Wraps a Handler
with the provided middleware, returning a new Handler
.
fn handler(self) -> Handler<HandlerError> where
Self: 'static + Fn(Request, Context) -> Result<Response<Body>, E> + Sized,
E: Send + Sync + Fail + From<Error>,
Self: 'static + Fn(Request, Context) -> Result<Response<Body>, E> + Sized,
E: Send + Sync + Fail + From<Error>,
Returns a Handler
that maps errors to HandlerError
, suitable for passing directly to
the lambda
macro.