pub enum CallError<E> {
Rejected {
state: CircuitState,
retry_after_ns: u64,
},
Inner(E),
}Expand description
Error returned by CircuitBreaker::call, distinguishing rejections from inner errors.
Variants§
Rejected
Circuit was open or half-open probe capacity was saturated.
Fields
§
state: CircuitStateCurrent circuit state at rejection time.
Inner(E)
The wrapped operation executed and returned an inner error.
Implementations§
Source§impl<E> CallError<E>
Convenience predicates for CallError.
impl<E> CallError<E>
Convenience predicates for CallError.
Sourcepub fn is_rejected(&self) -> bool
pub fn is_rejected(&self) -> bool
Sourcepub fn into_inner(self) -> Option<E>
pub fn into_inner(self) -> Option<E>
Trait Implementations§
impl<E: Copy> Copy for CallError<E>
impl<E: Eq> Eq for CallError<E>
Source§impl<E> Error for CallError<E>where
E: Error + 'static,
Marks CallError<E> as a standard error when E implements Error.
impl<E> Error for CallError<E>where
E: Error + 'static,
Marks CallError<E> as a standard error when E implements Error.
1.30.0 · 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()
impl<E: PartialEq> StructuralPartialEq for CallError<E>
Auto Trait Implementations§
impl<E> Forget for CallError<E>
impl<E> Freeze for CallError<E>where
E: Freeze,
impl<E> Move for CallError<E>
impl<E> RefUnwindSafe for CallError<E>where
E: RefUnwindSafe,
impl<E> Send for CallError<E>where
E: Send,
impl<E> Sync for CallError<E>where
E: Sync,
impl<E> Unpin for CallError<E>where
E: Unpin,
impl<E> UnsafeUnpin for CallError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for CallError<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