pub enum FallbackError<E> {
Inner(E),
FallbackFailed(E),
}Expand description
Error type for the fallback service.
Variants§
Inner(E)
The inner service failed and no fallback was applied (predicate didn’t match), or the error was transformed via the exception strategy.
FallbackFailed(E)
The fallback service itself failed.
Implementations§
Source§impl<E> FallbackError<E>
impl<E> FallbackError<E>
Sourcepub fn is_fallback_failed(&self) -> bool
pub fn is_fallback_failed(&self) -> bool
Returns true if the fallback itself failed.
Sourcepub fn into_inner(self) -> E
pub fn into_inner(self) -> E
Converts into the inner error.
Sourcepub fn map<F, U>(self, f: F) -> FallbackError<U>where
F: FnOnce(E) -> U,
pub fn map<F, U>(self, f: F) -> FallbackError<U>where
F: FnOnce(E) -> U,
Maps the inner error using the provided function.
Trait Implementations§
Source§impl<E: Clone> Clone for FallbackError<E>
impl<E: Clone> Clone for FallbackError<E>
Source§impl<E: Debug> Debug for FallbackError<E>
impl<E: Debug> Debug for FallbackError<E>
Source§impl<E: Display> Display for FallbackError<E>
impl<E: Display> Display for FallbackError<E>
Source§impl<E: Error + 'static> Error for FallbackError<E>
impl<E: Error + 'static> Error for FallbackError<E>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl<E> Freeze for FallbackError<E>where
E: Freeze,
impl<E> RefUnwindSafe for FallbackError<E>where
E: RefUnwindSafe,
impl<E> Send for FallbackError<E>where
E: Send,
impl<E> Sync for FallbackError<E>where
E: Sync,
impl<E> Unpin for FallbackError<E>where
E: Unpin,
impl<E> UnsafeUnpin for FallbackError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for FallbackError<E>where
E: 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