pub struct LatencyAndFailure { /* private fields */ }Expand description
A latency injector composed with a FailureSchedule.
Built via LatencyInjector::compose_with_schedule. Each
apply_blocking call sleeps for the latency profile’s delay and
then either returns Ok(()) or Err(InjectedFailure) based on
the schedule.
Implementations§
Source§impl LatencyAndFailure
impl LatencyAndFailure
Sourcepub fn apply_blocking(&self, attempt: usize) -> Result<(), InjectedFailure>
pub fn apply_blocking(&self, attempt: usize) -> Result<(), InjectedFailure>
Apply the latency for attempt, then check the schedule.
Returns Ok(()) if the schedule does not fire, or
Err(InjectedFailure) if it does. The latency is applied in
either case — the failure is appended after the slowdown.
Auto Trait Implementations§
impl !Freeze for LatencyAndFailure
impl RefUnwindSafe for LatencyAndFailure
impl Send for LatencyAndFailure
impl Sync for LatencyAndFailure
impl Unpin for LatencyAndFailure
impl UnsafeUnpin for LatencyAndFailure
impl UnwindSafe for LatencyAndFailure
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