pub struct LinkConfig {
pub min_latency: Micros,
pub max_latency: Micros,
pub drop_per_mille: u32,
pub duplicate_per_mille: u32,
}Expand description
Per-link behavior. Rates are per-mille to keep every decision in the integer domain.
Fields§
§min_latency: MicrosMinimum one-way latency in virtual micros.
max_latency: MicrosMaximum one-way latency in virtual micros (inclusive). A spread greater than zero reorders messages.
drop_per_mille: u32Per-mille chance a sent message is dropped.
duplicate_per_mille: u32Per-mille chance a sent message is duplicated.
Implementations§
Source§impl LinkConfig
impl LinkConfig
Sourcepub fn new(min_latency: Micros, max_latency: Micros) -> Self
pub fn new(min_latency: Micros, max_latency: Micros) -> Self
A link with fixed behavior and no faults.
Sourcepub fn with_drop_per_mille(self, per_mille: u32) -> Self
pub fn with_drop_per_mille(self, per_mille: u32) -> Self
Sets the drop rate.
Sourcepub fn with_duplicate_per_mille(self, per_mille: u32) -> Self
pub fn with_duplicate_per_mille(self, per_mille: u32) -> Self
Sets the duplication rate.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LinkConfig
Source§impl Debug for LinkConfig
impl Debug for LinkConfig
Source§impl Default for LinkConfig
impl Default for LinkConfig
impl Eq for LinkConfig
Source§impl PartialEq for LinkConfig
impl PartialEq for LinkConfig
impl StructuralPartialEq 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 UnsafeUnpin 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