Trait viz::HandlerExt

source ·
pub trait HandlerExt<I>: Handler<I> {
Show 13 methods fn boxed(
        self
    ) -> Box<dyn Handler<I, Output = Self::Output> + 'static, Global>
    where
        Self: Sized
, { ... } fn before<F>(self, f: F) -> Before<Self, F>
    where
        Self: Sized
, { ... } fn after<F>(self, f: F) -> After<Self, F>
    where
        Self: Sized
, { ... } fn around<F>(self, f: F) -> Around<Self, F>
    where
        Self: Sized
, { ... } fn map<F>(self, f: F) -> Map<Self, F>
    where
        Self: Sized
, { ... } fn map_into_response<O>(self) -> MapInToResponse<Self, O>
    where
        Self: Sized
, { ... } fn and_then<F>(self, f: F) -> AndThen<Self, F>
    where
        Self: Sized
, { ... } fn map_err<F>(self, f: F) -> MapErr<Self, F>
    where
        Self: Sized
, { ... } fn or_else<F>(self, f: F) -> OrElse<Self, F>
    where
        Self: Sized
, { ... } fn catch_error<F, R, E>(self, f: F) -> CatchError<Self, F, R, E>
    where
        Self: Sized
, { ... } fn catch_unwind<F>(self, f: F) -> CatchUnwind<Self, F>
    where
        Self: Sized
, { ... } fn with<T>(self, t: T) -> <T as Transform<Self>>::Output
    where
        T: Transform<Self>,
        Self: Sized
, { ... } fn with_fn<F>(self, f: F) -> Self
    where
        F: Fn(Self) -> Self,
        Self: Sized
, { ... }
}
Expand description

The HandlerExt trait, which provides adapters for chaining and composing handlers.

Likes the FutureExt and StreamExt trait.

Provided Methods§

Converts this Handler into a BoxHandler.

Maps the input before the handler calls.

Maps the output Result<T> after the handler called.

Wraps around the remaining handler or middleware chain.

Maps the Ok value of the output if after the handler called.

Maps the handler’s output type to the Response.

Calls op if the result is Ok, otherwise returns the Err value of self.

Maps the Err value of the output if after the handler called.

Calls op if the output is Err, otherwise returns the Ok value of the output.

Catches rejected error while calling the handler.

Catches unwinding panics while calling the handler.

Returns a new Handler that wrapping the Self and a type implementing Transform.

Maps the handler.

Implementors§