pub struct CatchError<H, F, E, R> { /* private fields */ }
Expand description
Catches rejected error while calling the handler.
Implementations§
Source§impl<H, F, E, R> CatchError<H, F, E, R>
impl<H, F, E, R> CatchError<H, F, E, R>
Sourcepub fn new(h: H, f: F) -> Self
pub fn new(h: H, f: F) -> Self
Creates a CatchError
handler.
Trait Implementations§
Source§impl<H, F, E, R> Clone for CatchError<H, F, E, R>
impl<H, F, E, R> Clone for CatchError<H, F, E, R>
Source§impl<H, I, O, F, E, R> Handler<I> for CatchError<H, F, E, R>where
I: Send + 'static,
H: Handler<I, Output = Result<O>>,
O: IntoResponse + Send,
E: Error + Send + 'static,
F: Handler<E, Output = R>,
R: IntoResponse + 'static,
impl<H, I, O, F, E, R> Handler<I> for CatchError<H, F, E, R>where
I: Send + 'static,
H: Handler<I, Output = Result<O>>,
O: IntoResponse + Send,
E: Error + Send + 'static,
F: Handler<E, Output = R>,
R: IntoResponse + 'static,
Auto Trait Implementations§
impl<H, F, E, R> Freeze for CatchError<H, F, E, R>
impl<H, F, E, R> RefUnwindSafe for CatchError<H, F, E, R>where
H: RefUnwindSafe,
F: RefUnwindSafe,
impl<H, F, E, R> Send for CatchError<H, F, E, R>
impl<H, F, E, R> Sync for CatchError<H, F, E, R>
impl<H, F, E, R> Unpin for CatchError<H, F, E, R>
impl<H, F, E, R> UnwindSafe for CatchError<H, F, E, R>where
H: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<I, T> HandlerExt<I> for T
impl<I, T> HandlerExt<I> for T
Source§fn before<F>(self, f: F) -> Before<Self, F>where
Self: Sized,
fn before<F>(self, f: F) -> Before<Self, F>where
Self: Sized,
Maps the input before the handler calls.
Source§fn after<F>(self, f: F) -> After<Self, F>where
Self: Sized,
fn after<F>(self, f: F) -> After<Self, F>where
Self: Sized,
Maps the output
Result<T>
after the handler called.Source§fn around<F>(self, f: F) -> Around<Self, F>where
Self: Sized,
fn around<F>(self, f: F) -> Around<Self, F>where
Self: Sized,
Wraps around the remaining handler or middleware chain.
Source§fn either<R>(self, r: R, enable: bool) -> Either<Self, R>where
Self: Sized,
fn either<R>(self, r: R, enable: bool) -> Either<Self, R>where
Self: Sized,
Wraps this handler in an Either handler, making it the left-hand variant of that Either. Read more
Source§fn map<F>(self, f: F) -> Map<Self, F>where
Self: Sized,
fn map<F>(self, f: F) -> Map<Self, F>where
Self: Sized,
Maps the
Ok
value of the output if after the handler called.Source§fn map_into_response(self) -> MapInToResponse<Self>where
Self: Sized,
fn map_into_response(self) -> MapInToResponse<Self>where
Self: Sized,
Maps the handler’s output type to the
Response
.Source§fn and_then<F>(self, f: F) -> AndThen<Self, F>where
Self: Sized,
fn and_then<F>(self, f: F) -> AndThen<Self, F>where
Self: Sized,
Calls op if the result is Ok, otherwise returns the Err value of self.
Source§fn map_err<F>(self, f: F) -> MapErr<Self, F>where
Self: Sized,
fn map_err<F>(self, f: F) -> MapErr<Self, F>where
Self: Sized,
Maps the
Err
value of the output if after the handler called.Source§fn or_else<F>(self, f: F) -> OrElse<Self, F>where
Self: Sized,
fn or_else<F>(self, f: F) -> OrElse<Self, F>where
Self: Sized,
Calls
op
if the output is Err
, otherwise returns the Ok
value of the output.Source§fn catch_error<F, E, R>(self, f: F) -> CatchError<Self, F, E, R>where
Self: Sized,
fn catch_error<F, E, R>(self, f: F) -> CatchError<Self, F, E, R>where
Self: Sized,
Catches rejected error while calling the handler.
Source§fn catch_unwind<F>(self, f: F) -> CatchUnwind<Self, F>where
Self: Sized,
fn catch_unwind<F>(self, f: F) -> CatchUnwind<Self, F>where
Self: Sized,
Catches unwinding panics while calling the handler.
Source§fn boxed(self) -> BoxHandler<I, Self::Output>
fn boxed(self) -> BoxHandler<I, Self::Output>
Converts this Handler into a
BoxHandler
.