pub struct CircuitConfig {
pub failure_threshold: u32,
pub success_threshold: u32,
pub half_open_failure_threshold: u32,
pub reset_timeout: Duration,
pub window_duration: Duration,
}Expand description
Circuit breaker configuration
Fields§
§failure_threshold: u32Failure threshold to trip circuit
success_threshold: u32Success threshold in half-open to close
half_open_failure_threshold: u32Failure threshold in half-open before re-opening (allows a few test failures)
reset_timeout: DurationTime to wait in open state before testing
window_duration: DurationRolling window for failures
Implementations§
Source§impl CircuitConfig
impl CircuitConfig
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Conservative settings for critical services
Sourcepub fn aggressive() -> Self
pub fn aggressive() -> Self
Aggressive settings for non-critical services
Trait Implementations§
Source§impl Clone for CircuitConfig
impl Clone for CircuitConfig
Source§fn clone(&self) -> CircuitConfig
fn clone(&self) -> CircuitConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CircuitConfig
impl Debug for CircuitConfig
Auto Trait Implementations§
impl Freeze for CircuitConfig
impl RefUnwindSafe for CircuitConfig
impl Send for CircuitConfig
impl Sync for CircuitConfig
impl Unpin for CircuitConfig
impl UnwindSafe for CircuitConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more