#[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()