pub struct FaultInjector { /* private fields */ }Expand description
Test-owned, FIFO fault queues indexed by a stable boundary label.
A queued fault is consumed only when Self::check reaches the matching
boundary. No fault is implicit, and an empty queue always permits work.
Implementations§
Source§impl FaultInjector
impl FaultInjector
Sourcepub fn inject(
&self,
point: &str,
fault: SimulatorFault,
) -> Result<(), FaultPointError>
pub fn inject( &self, point: &str, fault: SimulatorFault, ) -> Result<(), FaultPointError>
Queues one fault for the next visit to point.
Sourcepub fn inject_at(
&self,
operation: &str,
boundary: ScenarioBoundary,
fault: SimulatorFault,
) -> Result<(), FaultPointError>
pub fn inject_at( &self, operation: &str, boundary: ScenarioBoundary, fault: SimulatorFault, ) -> Result<(), FaultPointError>
Queues one fault at a canonical boundary belonging to operation.
Sourcepub fn check(
&self,
point: &str,
) -> Result<Result<(), SimulatorFault>, FaultPointError>
pub fn check( &self, point: &str, ) -> Result<Result<(), SimulatorFault>, FaultPointError>
Consumes and returns the next configured fault at point, if any.
Sourcepub fn check_at(
&self,
operation: &str,
boundary: ScenarioBoundary,
) -> Result<Result<(), SimulatorFault>, FaultPointError>
pub fn check_at( &self, operation: &str, boundary: ScenarioBoundary, ) -> Result<Result<(), SimulatorFault>, FaultPointError>
Checks the next fault at a canonical boundary belonging to operation.
Sourcepub fn has_pending(&self, point: &str) -> Result<bool, FaultPointError>
pub fn has_pending(&self, point: &str) -> Result<bool, FaultPointError>
Returns whether a boundary still has queued faults.
Trait Implementations§
Source§impl Clone for FaultInjector
impl Clone for FaultInjector
Source§impl Debug for FaultInjector
impl Debug for FaultInjector
Auto Trait Implementations§
impl !RefUnwindSafe for FaultInjector
impl !Send for FaultInjector
impl !Sync for FaultInjector
impl !UnwindSafe for FaultInjector
impl Freeze for FaultInjector
impl Unpin for FaultInjector
impl UnsafeUnpin for FaultInjector
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