#[non_exhaustive]pub enum BreakerError {
Open,
}Expand description
#[non_exhaustive] — consumers MUST add a catch-all arm. New variants
will be added in future minor releases (e.g. HalfOpen or Forced) to
surface state transitions that consumers may want to react to.
A circuit-open error is NOT retryable. A breaker’s whole purpose is
to STOP hammering a failing upstream. Callers that receive BreakerError
MUST short-circuit the retry loop and return the error to the user. The
BreakerError::is_retryable method exists to make this contract
machine-checkable: integrations that map breaker errors into a provider
retry loop should branch on it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Open
The circuit is open: too many consecutive failures, or the reset timeout has not yet elapsed since the last failure.
Implementations§
Source§impl BreakerError
impl BreakerError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns false. A circuit-open error is a deliberate stop signal;
retrying would burn the retry budget against a known-open circuit and
is the exact behavior the breaker exists to prevent.
Trait Implementations§
Source§impl Clone for BreakerError
impl Clone for BreakerError
Source§fn clone(&self) -> BreakerError
fn clone(&self) -> BreakerError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BreakerError
impl Debug for BreakerError
Source§impl Display for BreakerError
impl Display for BreakerError
Source§impl Error for BreakerError
impl Error for BreakerError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for BreakerError
impl RefUnwindSafe for BreakerError
impl Send for BreakerError
impl Sync for BreakerError
impl Unpin for BreakerError
impl UnsafeUnpin for BreakerError
impl UnwindSafe for BreakerError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.