pub struct CircuitBreakerConfig {
pub failure_threshold: u32,
pub failure_window: Duration,
pub success_threshold: u32,
pub reset_timeout: Duration,
}Expand description
Static configuration for a CircuitBreaker.
Fields§
§failure_threshold: u32Failures observed within failure_window before the breaker opens.
failure_window: DurationRolling window for failure counting in the Closed state. Failures older than this are discarded from the sliding count.
success_threshold: u32Consecutive successes required in the HalfOpen state before the breaker transitions back to Closed.
reset_timeout: DurationTime the breaker remains Open before a HalfOpen probe is allowed.
Trait Implementations§
Source§impl Clone for CircuitBreakerConfig
impl Clone for CircuitBreakerConfig
Source§fn clone(&self) -> CircuitBreakerConfig
fn clone(&self) -> CircuitBreakerConfig
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 CircuitBreakerConfig
impl Debug for CircuitBreakerConfig
Source§impl Default for CircuitBreakerConfig
impl Default for CircuitBreakerConfig
Source§fn default() -> CircuitBreakerConfig
fn default() -> CircuitBreakerConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CircuitBreakerConfig
impl RefUnwindSafe for CircuitBreakerConfig
impl Send for CircuitBreakerConfig
impl Sync for CircuitBreakerConfig
impl Unpin for CircuitBreakerConfig
impl UnsafeUnpin for CircuitBreakerConfig
impl UnwindSafe for CircuitBreakerConfig
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