pub struct FaultConfig {
pub message_loss: (u32, u32),
pub message_reorder: (u32, u32),
pub message_delay: (u32, u32),
pub max_delay: Duration,
pub corruption: (u32, u32),
pub timeout: (u32, u32),
}Expand description
Controls which faults the simulation bus may inject and at what rates.
All probabilities are expressed as (numerator, denominator) pairs. For example (1, 100)
means a 1% chance per eligible event.
Fields§
§message_loss: (u32, u32)Probability a message is silently dropped.
message_reorder: (u32, u32)Probability two consecutive messages are reordered.
message_delay: (u32, u32)Probability a message is delayed. Delay duration is drawn uniformly from 0..max_delay_us.
max_delay: Duration§corruption: (u32, u32)Probability a message payload byte is corrupted. Applied per-byte independently.
timeout: (u32, u32)Probability a respponse is replaced with a timeout (i.e suppressed entirely, forcing the sender to timeout)
Implementations§
Trait Implementations§
Source§impl Clone for FaultConfig
impl Clone for FaultConfig
Source§fn clone(&self) -> FaultConfig
fn clone(&self) -> FaultConfig
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 moreAuto Trait Implementations§
impl Freeze for FaultConfig
impl RefUnwindSafe for FaultConfig
impl Send for FaultConfig
impl Sync for FaultConfig
impl Unpin for FaultConfig
impl UnsafeUnpin for FaultConfig
impl UnwindSafe for FaultConfig
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