pub struct ModeledNetwork { /* private fields */ }Expand description
Shared simulated network with scheduled delivery, jitter, packet loss, and coarse collision modeling.
Implementations§
Source§impl ModeledNetwork
impl ModeledNetwork
Sourcepub fn with_clock(clock: DummyClock) -> Self
pub fn with_clock(clock: DummyClock) -> Self
Create an empty modeled network using a caller-supplied shared clock.
Sourcepub fn clock(&self) -> DummyClock
pub fn clock(&self) -> DummyClock
Return the shared modeled clock.
Sourcepub fn advance_ms(&self, delta_ms: u64)
pub fn advance_ms(&self, delta_ms: u64)
Advance the shared simulation time.
Sourcepub fn reseed(&self, seed: u64)
pub fn reseed(&self, seed: u64)
Override the deterministic RNG seed used for loss/jitter sampling.
Sourcepub fn add_radio(&self) -> ModeledRadio
pub fn add_radio(&self) -> ModeledRadio
Add a modeled radio with default limits.
Sourcepub fn add_radio_with_config(
&self,
max_frame_size: usize,
t_frame_ms: u32,
) -> ModeledRadio
pub fn add_radio_with_config( &self, max_frame_size: usize, t_frame_ms: u32, ) -> ModeledRadio
Add a modeled radio with explicit frame-size and airtime limits.
Sourcepub fn connect(&self, from: usize, to: usize)
pub fn connect(&self, from: usize, to: usize)
Connect from to to using the default modeled link profile.
Sourcepub fn connect_bidirectional(&self, a: usize, b: usize)
pub fn connect_bidirectional(&self, a: usize, b: usize)
Connect two radios in both directions using the default modeled link profile.
Sourcepub fn disconnect(&self, from: usize, to: usize)
pub fn disconnect(&self, from: usize, to: usize)
Remove the directed link from from to to.
Sourcepub fn set_link_profile(
&self,
from: usize,
to: usize,
profile: ModeledLinkProfile,
)
pub fn set_link_profile( &self, from: usize, to: usize, profile: ModeledLinkProfile, )
Configure one directed link with an explicit modeled profile.
Sourcepub fn has_pending_deliveries(&self) -> bool
pub fn has_pending_deliveries(&self) -> bool
Return whether any future deliveries are still pending.
Trait Implementations§
Source§impl Clone for ModeledNetwork
impl Clone for ModeledNetwork
Source§fn clone(&self) -> ModeledNetwork
fn clone(&self) -> ModeledNetwork
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ModeledNetwork
impl !RefUnwindSafe for ModeledNetwork
impl !Send for ModeledNetwork
impl !Sync for ModeledNetwork
impl Unpin for ModeledNetwork
impl !UnwindSafe for ModeledNetwork
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)