pub struct NetworkConfig {
pub latency: Duration,
pub jitter: Duration,
pub loss_rate: f64,
pub burst_loss_prob: f64,
pub reorder_rate: f64,
pub duplicate_prob: f64,
pub bandwidth: Option<u64>,
pub nat_rebind_prob: f64,
}Expand description
Configuration for the simulated network conditions.
Fields§
§latency: DurationBase latency for packets.
jitter: DurationMaximum additional random delay added to packets.
loss_rate: f64Probability of a packet being dropped (0.0 to 1.0).
burst_loss_prob: f64Probability of entering or continuing a burst loss state (0.0 to 1.0).
reorder_rate: f64Probability of a packet being delayed extra to cause reordering (0.0 to 1.0).
duplicate_prob: f64Probability of a packet being duplicated (0.0 to 1.0).
bandwidth: Option<u64>Maximum bandwidth in bytes per second (for transmission rate delay calculation).
nat_rebind_prob: f64Probability of a NAT rebinding occurring, changing the source port.
Trait Implementations§
Source§impl Clone for NetworkConfig
impl Clone for NetworkConfig
Source§fn clone(&self) -> NetworkConfig
fn clone(&self) -> NetworkConfig
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 moreSource§impl Debug for NetworkConfig
impl Debug for NetworkConfig
Auto Trait Implementations§
impl Freeze for NetworkConfig
impl RefUnwindSafe for NetworkConfig
impl Send for NetworkConfig
impl Sync for NetworkConfig
impl Unpin for NetworkConfig
impl UnsafeUnpin for NetworkConfig
impl UnwindSafe for NetworkConfig
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