pub enum ResilienceError<E> {
CircuitOpen {
key: String,
},
BulkheadFull {
key: String,
limit: usize,
},
Timeout {
after: Duration,
},
Inner(E),
}Expand description
A failure surfaced by the resilience layer wrapping a caller’s operation.
ResilienceError::Inner carries the caller’s own error E unchanged
(after retries are exhausted). The other variants are produced by the guard
itself and the caller is expected to map them into its domain error enum.
Variants§
CircuitOpen
The circuit breaker is open; the call was rejected without being attempted.
BulkheadFull
The bulkhead is saturated; the call was rejected to protect capacity.
Timeout
The operation exceeded its per-attempt timeout on every retry.
Inner(E)
The caller’s operation failed (retries exhausted, or a permanent failure).
Trait Implementations§
Source§impl<E: Debug> Debug for ResilienceError<E>
impl<E: Debug> Debug for ResilienceError<E>
Source§impl<E> Display for ResilienceError<E>where
E: Display,
impl<E> Display for ResilienceError<E>where
E: Display,
Source§impl<E> Error for ResilienceError<E>
impl<E> Error for ResilienceError<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 ResilienceError<E>where
E: Freeze,
impl<E> RefUnwindSafe for ResilienceError<E>where
E: RefUnwindSafe,
impl<E> Send for ResilienceError<E>where
E: Send,
impl<E> Sync for ResilienceError<E>where
E: Sync,
impl<E> Unpin for ResilienceError<E>where
E: Unpin,
impl<E> UnsafeUnpin for ResilienceError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for ResilienceError<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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.