#[repr(u8)]pub enum CircuitState {
Closed = 0,
Open = 1,
HalfOpen = 2,
}Expand description
Circuit breaker states.
The circuit breaker transitions between these states based on request success/failure patterns.
Variants§
Closed = 0
Normal operation, requests are allowed. Failures are counted, and if they exceed the threshold, the circuit transitions to Open.
Open = 1
Blocking requests due to failures.
All requests are rejected immediately with a ResourceExhausted error.
After reset_timeout elapses, transitions to HalfOpen.
HalfOpen = 2
Testing if the service has recovered. Allows a limited number of test requests. If successful, transitions to Closed; if failed, transitions back to Open.
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 PartialEq for CircuitState
impl PartialEq for CircuitState
impl Copy for CircuitState
impl Eq for CircuitState
impl StructuralPartialEq 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 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