pub struct Config<POLICY, INSTRUMENT> { /* private fields */ }
Expand description
A CircuitBreaker
’s configuration.
Implementations
sourceimpl Config<(), ()>
impl Config<(), ()>
sourcepub fn new(
) -> Config<OrElse<SuccessRateOverTimeWindow<EqualJittered>, ConsecutiveFailures<EqualJittered>>, ()>
pub fn new(
) -> Config<OrElse<SuccessRateOverTimeWindow<EqualJittered>, ConsecutiveFailures<EqualJittered>>, ()>
Creates a new circuit breaker’s default configuration.
sourceimpl<POLICY, INSTRUMENT> Config<POLICY, INSTRUMENT>
impl<POLICY, INSTRUMENT> Config<POLICY, INSTRUMENT>
sourcepub fn failure_policy<T>(self, failure_policy: T) -> Config<T, INSTRUMENT> where
T: FailurePolicy,
pub fn failure_policy<T>(self, failure_policy: T) -> Config<T, INSTRUMENT> where
T: FailurePolicy,
Configures FailurePolicy
for a circuit breaker.
sourcepub fn instrument<T>(self, instrument: T) -> Config<POLICY, T> where
T: Instrument,
pub fn instrument<T>(self, instrument: T) -> Config<POLICY, T> where
T: Instrument,
Configures Instrument
for a circuit breaker.
sourcepub fn build(self) -> StateMachine<POLICY, INSTRUMENT> where
POLICY: FailurePolicy,
INSTRUMENT: Instrument,
pub fn build(self) -> StateMachine<POLICY, INSTRUMENT> where
POLICY: FailurePolicy,
INSTRUMENT: Instrument,
Builds a new circuit breaker instance.
Trait Implementations
Auto Trait Implementations
impl<POLICY, INSTRUMENT> RefUnwindSafe for Config<POLICY, INSTRUMENT> where
INSTRUMENT: RefUnwindSafe,
POLICY: RefUnwindSafe,
impl<POLICY, INSTRUMENT> Send for Config<POLICY, INSTRUMENT> where
INSTRUMENT: Send,
POLICY: Send,
impl<POLICY, INSTRUMENT> Sync for Config<POLICY, INSTRUMENT> where
INSTRUMENT: Sync,
POLICY: Sync,
impl<POLICY, INSTRUMENT> Unpin for Config<POLICY, INSTRUMENT> where
INSTRUMENT: Unpin,
POLICY: Unpin,
impl<POLICY, INSTRUMENT> UnwindSafe for Config<POLICY, INSTRUMENT> where
INSTRUMENT: UnwindSafe,
POLICY: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more