pub struct SimulatorConfig {
pub base_latency_ms: u64,
pub latency_variance_ms: u64,
pub packet_loss_rate: f64,
pub bandwidth_limit_bps: u64,
pub spike_probability: f64,
pub spike_multiplier: u64,
pub enable_reordering: bool,
pub reorder_probability: f64,
pub max_reorder_delay_ms: u64,
}Expand description
Configuration for the network simulator
Fields§
§base_latency_ms: u64Base latency in milliseconds
latency_variance_ms: u64Latency variance in milliseconds (for jitter)
packet_loss_rate: f64Packet loss rate (0.0 to 1.0)
bandwidth_limit_bps: u64Bandwidth limit in bytes per second (0 = unlimited)
spike_probability: f64Probability of latency spikes (0.0 to 1.0)
spike_multiplier: u64Spike latency multiplier
enable_reordering: boolEnable packet reordering
reorder_probability: f64Reordering probability (0.0 to 1.0)
max_reorder_delay_ms: u64Maximum reorder delay in milliseconds
Implementations§
Source§impl SimulatorConfig
impl SimulatorConfig
Sourcepub fn from_condition(condition: NetworkCondition) -> Self
pub fn from_condition(condition: NetworkCondition) -> Self
Create configuration for a specific network condition
Sourcepub fn validate(&self) -> Result<(), SimulatorError>
pub fn validate(&self) -> Result<(), SimulatorError>
Validate configuration
Trait Implementations§
Source§impl Clone for SimulatorConfig
impl Clone for SimulatorConfig
Source§fn clone(&self) -> SimulatorConfig
fn clone(&self) -> SimulatorConfig
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 SimulatorConfig
impl Debug for SimulatorConfig
Auto Trait Implementations§
impl Freeze for SimulatorConfig
impl RefUnwindSafe for SimulatorConfig
impl Send for SimulatorConfig
impl Sync for SimulatorConfig
impl Unpin for SimulatorConfig
impl UnwindSafe for SimulatorConfig
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more