pub struct CircuitBreakerBuilder { /* private fields */ }Expand description
Builder for CircuitBreaker.
Implementations§
Source§impl CircuitBreakerBuilder
impl CircuitBreakerBuilder
Sourcepub fn failure_threshold(self, n: u32) -> Self
pub fn failure_threshold(self, n: u32) -> Self
Number of consecutive failures before the breaker trips. Default: 5.
Sourcepub fn cool_down(self, d: Duration) -> Self
pub fn cool_down(self, d: Duration) -> Self
How long the breaker stays open before allowing a trial. Default: 30s.
Sourcepub fn half_open_max_calls(self, n: u32) -> Self
pub fn half_open_max_calls(self, n: u32) -> Self
How many calls to admit in HalfOpen. Default: 1.
Sourcepub fn build(self) -> CircuitBreaker
pub fn build(self) -> CircuitBreaker
Finalize the breaker.
Trait Implementations§
Source§impl Clone for CircuitBreakerBuilder
impl Clone for CircuitBreakerBuilder
Source§fn clone(&self) -> CircuitBreakerBuilder
fn clone(&self) -> CircuitBreakerBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CircuitBreakerBuilder
impl Debug for CircuitBreakerBuilder
Auto Trait Implementations§
impl Freeze for CircuitBreakerBuilder
impl RefUnwindSafe for CircuitBreakerBuilder
impl Send for CircuitBreakerBuilder
impl Sync for CircuitBreakerBuilder
impl Unpin for CircuitBreakerBuilder
impl UnsafeUnpin for CircuitBreakerBuilder
impl UnwindSafe for CircuitBreakerBuilder
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