#[non_exhaustive]pub enum Trip {
Consecutive(u32),
Ratio {
window: u32,
ratio: f64,
min_calls: u32,
},
Windowed {
failures: u32,
period: Duration,
},
}Available on crate feature
circuit-breaker only.Expand description
The condition under which a closed breaker trips open.
#[non_exhaustive]: more trip conditions may be added.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Consecutive(u32)
Trip after this many consecutive failures (a success resets the count).
Ratio
Trip when the failure ratio over the last window calls reaches ratio,
once at least min_calls have been observed.
Fields
Windowed
Trip when at least failures failures occur within a rolling period.
Trait Implementations§
impl Copy for Trip
impl StructuralPartialEq for Trip
Auto Trait Implementations§
impl Freeze for Trip
impl RefUnwindSafe for Trip
impl Send for Trip
impl Sync for Trip
impl Unpin for Trip
impl UnsafeUnpin for Trip
impl UnwindSafe for Trip
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