pub enum CircuitState {
Closed,
Open {
opened_at: Instant,
},
HalfOpen,
}Expand description
Tracks failure rates and opens when the threshold is exceeded.
States: Closed (normal) → Open (fast-fail) → HalfOpen (probe).
Note: PartialEq is implemented manually because the Open variant
contains std::time::Instant which does not implement Eq. The manual
implementation compares only the variant discriminant, not the timestamp.
Variants§
Closed
Circuit is operating normally; requests pass through.
Open
Circuit has tripped; requests are fast-failed without calling the operation.
HalfOpen
Recovery probe period; the next request will be attempted to test recovery.
Trait Implementations§
Source§impl Clone for CircuitState
impl Clone for CircuitState
Source§fn clone(&self) -> CircuitState
fn clone(&self) -> CircuitState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CircuitState
impl Debug for CircuitState
Source§impl Display for CircuitState
impl Display for CircuitState
Source§impl PartialEq for CircuitState
impl PartialEq for CircuitState
impl Eq for CircuitState
Auto Trait Implementations§
impl Freeze for CircuitState
impl RefUnwindSafe for CircuitState
impl Send for CircuitState
impl Sync for CircuitState
impl Unpin for CircuitState
impl UnsafeUnpin for CircuitState
impl UnwindSafe for CircuitState
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