pub struct OutboxFaultInjector { /* private fields */ }Expand description
Controls outbox delivery fault injection for testing.
When remaining_failures > 0, deliver_intents_best_effort will skip
delivery (simulating a network failure) and decrement the counter.
Once it reaches 0, delivery proceeds normally.
The reconciler is NOT affected by fault injection — it always delivers. This models the real failure mode: immediate delivery fails, reconciler picks up the slack.
Implementations§
Source§impl OutboxFaultInjector
impl OutboxFaultInjector
Sourcepub fn fail_next(n: u32) -> Self
pub fn fail_next(n: u32) -> Self
Create a fault injector that will cause the next n best-effort
delivery attempts to silently fail. The background reconciler
is unaffected and will deliver the intents.
Sourcepub fn should_fail(&self) -> bool
pub fn should_fail(&self) -> bool
Returns true if delivery should be suppressed (and decrements the counter).
Trait Implementations§
Source§impl Clone for OutboxFaultInjector
impl Clone for OutboxFaultInjector
Source§fn clone(&self) -> OutboxFaultInjector
fn clone(&self) -> OutboxFaultInjector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OutboxFaultInjector
impl RefUnwindSafe for OutboxFaultInjector
impl Send for OutboxFaultInjector
impl Sync for OutboxFaultInjector
impl Unpin for OutboxFaultInjector
impl UnsafeUnpin for OutboxFaultInjector
impl UnwindSafe for OutboxFaultInjector
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