pub struct RandomPanicMiddleware {
pub mode: FaultMode,
pub trigger_on_message: Option<usize>,
pub enabled: bool,
pub message_count: Arc<AtomicUsize>,
}Expand description
Middleware for fault injection testing.
Allows testing error handling and recovery mechanisms by injecting faults at specific points in the message processing pipeline.
§Examples
random_panic:
mode: panic
trigger_on_message: 3 # Trigger on the 3rd messageFields§
§mode: FaultModeThe type of fault to inject.
trigger_on_message: Option<usize>Trigger the fault on the Nth message (1-indexed). None = trigger on every message.
enabled: boolEnable/disable the fault injection without removing the configuration.
message_count: Arc<AtomicUsize>Trait Implementations§
Source§impl Clone for RandomPanicMiddleware
impl Clone for RandomPanicMiddleware
Source§fn clone(&self) -> RandomPanicMiddleware
fn clone(&self) -> RandomPanicMiddleware
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RandomPanicMiddleware
impl Debug for RandomPanicMiddleware
Source§impl Default for RandomPanicMiddleware
impl Default for RandomPanicMiddleware
Source§fn default() -> RandomPanicMiddleware
fn default() -> RandomPanicMiddleware
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RandomPanicMiddleware
impl<'de> Deserialize<'de> for RandomPanicMiddleware
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RandomPanicMiddleware
impl RefUnwindSafe for RandomPanicMiddleware
impl Send for RandomPanicMiddleware
impl Sync for RandomPanicMiddleware
impl Unpin for RandomPanicMiddleware
impl UnsafeUnpin for RandomPanicMiddleware
impl UnwindSafe for RandomPanicMiddleware
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