pub struct FaultRegistry { /* private fields */ }Expand description
Thread-safe registry of active fault injection rules.
Implementations§
Source§impl FaultRegistry
impl FaultRegistry
Sourcepub fn inject(&self, config: FaultConfig)
pub fn inject(&self, config: FaultConfig)
Register a fault for a command.
Sourcepub fn check_and_trigger(&self, command: &str) -> Option<FaultType>
pub fn check_and_trigger(&self, command: &str) -> Option<FaultType>
Look up and optionally trigger a fault for a command. Returns the fault type if one is active and should trigger.
Sourcepub fn list(&self) -> Vec<FaultConfig>
pub fn list(&self) -> Vec<FaultConfig>
List all active fault rules.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FaultRegistry
impl RefUnwindSafe for FaultRegistry
impl Send for FaultRegistry
impl Sync for FaultRegistry
impl Unpin for FaultRegistry
impl UnsafeUnpin for FaultRegistry
impl UnwindSafe for FaultRegistry
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