#[non_exhaustive]pub struct LinkConfig {
pub delay: Duration,
pub loss: f64,
pub blocked: bool,
pub jitter: Duration,
pub reorder: bool,
pub rate_bps: Option<u64>,
pub queue: Duration,
}Expand description
One direction between two IP addresses of the MockNet.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.delay: DurationOne-way delay (TCP’s handshake takes two).
loss: f64The share of datagrams lost, 0.0 to 1.0, drawn from the runtime’s seed.
blocked: boolNothing passes: datagrams are lost, connection attempts never complete.
jitter: DurationExtra delay per datagram, uniform between zero and this, drawn from the runtime’s
seed. UDP only (TCP takes delay).
reorder: boolWhether jitter may reorder datagrams. Off: a datagram never arrives before one sent earlier on the link (the delay variation of one queue); on: each is delayed on its own (several paths).
rate_bps: Option<u64>The link’s capacity in bits per second (None: unlimited): each datagram takes its
size at this rate to leave, after those before it. UDP only.
queue: DurationWith a rate: how long a datagram may wait for the link before it is dropped
(Fate::QueueFull, a drop-tail queue), as time at the link’s rate.
Implementations§
Source§impl LinkConfig
impl LinkConfig
Sourcepub fn with_delay(self, delay: Duration) -> Self
pub fn with_delay(self, delay: Duration) -> Self
With a one-way delay.
Sourcepub fn with_blocked(self, blocked: bool) -> Self
pub fn with_blocked(self, blocked: bool) -> Self
blocked or not.
Sourcepub fn with_jitter(self, jitter: Duration) -> Self
pub fn with_jitter(self, jitter: Duration) -> Self
With a jitter.
Sourcepub fn with_reorder(self, reorder: bool) -> Self
pub fn with_reorder(self, reorder: bool) -> Self
Whether jitter may reorder.
Sourcepub fn with_rate_bps(self, rate_bps: u64) -> Self
pub fn with_rate_bps(self, rate_bps: u64) -> Self
With a rate limit (rate_bps).
Sourcepub fn with_queue(self, queue: Duration) -> Self
pub fn with_queue(self, queue: Duration) -> Self
With a queue for the rate limit.
Trait Implementations§
Source§impl Clone for LinkConfig
impl Clone for LinkConfig
impl Copy for LinkConfig
Source§impl Debug for LinkConfig
impl Debug for LinkConfig
Source§impl Default for LinkConfig
impl Default for LinkConfig
Source§impl PartialEq for LinkConfig
impl PartialEq for LinkConfig
impl StructuralPartialEq for LinkConfig
Auto Trait Implementations§
impl Forget for LinkConfig
impl Freeze for LinkConfig
impl Move 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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.