pub struct ChaosTester { /* private fields */ }Expand description
Chaos tester: tracks failures injected and verifies resilience.
Implementations§
Source§impl ChaosTester
impl ChaosTester
pub fn new(config: ChaosConfig) -> Self
Sourcepub fn inject(&mut self, operation: &str) -> FailureMode
pub fn inject(&mut self, operation: &str) -> FailureMode
Decide whether to inject a failure for the given operation.
Sourcepub fn injections(&self) -> &[ChaosInjection]
pub fn injections(&self) -> &[ChaosInjection]
All injections recorded.
Sourcepub fn count_by_mode(&self) -> HashMap<FailureMode, usize>
pub fn count_by_mode(&self) -> HashMap<FailureMode, usize>
Count injections by mode.
Sourcepub fn total_injections(&self) -> usize
pub fn total_injections(&self) -> usize
Number of total operations.
Auto Trait Implementations§
impl Freeze for ChaosTester
impl RefUnwindSafe for ChaosTester
impl Send for ChaosTester
impl Sync for ChaosTester
impl Unpin for ChaosTester
impl UnsafeUnpin for ChaosTester
impl UnwindSafe for ChaosTester
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