pub struct LinkConfig {
pub delay: Duration,
pub jitter: Duration,
pub loss_rate: f64,
pub bandwidth_bps: u64,
}Expand description
Link properties for a simulated connection.
Fields§
§delay: DurationBase one-way propagation delay.
jitter: DurationRandom jitter added to each packet’s delay (uniform in [0, jitter]).
loss_rate: f64Packet loss rate (0.0 = no loss, 1.0 = all packets dropped).
bandwidth_bps: u64Link bandwidth in bits per second. 0 means unlimited.
Implementations§
Source§impl LinkConfig
impl LinkConfig
Sourcepub fn lossy_wireless() -> Self
pub fn lossy_wireless() -> Self
Lossy wireless link: 10ms delay, 5% loss, 11 Mbps.
Trait Implementations§
Source§impl Clone for LinkConfig
impl Clone for LinkConfig
Source§fn clone(&self) -> LinkConfig
fn clone(&self) -> LinkConfig
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 LinkConfig
impl Debug for LinkConfig
Auto Trait Implementations§
impl Freeze for LinkConfig
impl RefUnwindSafe for LinkConfig
impl Send for LinkConfig
impl Sync for LinkConfig
impl Unpin for LinkConfig
impl UnwindSafe for LinkConfig
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