pub struct LossSimulator { /* private fields */ }Expand description
Packet loss simulator for testing.
Simulates various network failure conditions.
Implementations§
Source§impl LossSimulator
impl LossSimulator
Sourcepub fn with_bursts(self, burst_prob: f32, burst_length: u32) -> Self
pub fn with_bursts(self, burst_prob: f32, burst_length: u32) -> Self
Create with burst loss behavior
Sourcepub fn should_drop(&self) -> bool
pub fn should_drop(&self) -> bool
Check if a packet should be dropped
Sourcepub fn effective_loss_rate(&self) -> f32
pub fn effective_loss_rate(&self) -> f32
Get current effective loss rate
Auto Trait Implementations§
impl !Freeze for LossSimulator
impl RefUnwindSafe for LossSimulator
impl Send for LossSimulator
impl Sync for LossSimulator
impl Unpin for LossSimulator
impl UnsafeUnpin for LossSimulator
impl UnwindSafe for LossSimulator
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