pub struct SimLink;Expand description
A simulated bidirectional link between two faces.
Implementations§
Source§impl SimLink
impl SimLink
Sourcepub fn pair(
id_a: FaceId,
id_b: FaceId,
config: LinkConfig,
buffer: usize,
) -> (SimFace, SimFace)
pub fn pair( id_a: FaceId, id_b: FaceId, config: LinkConfig, buffer: usize, ) -> (SimFace, SimFace)
Create a pair of connected SimFaces with the given link properties.
Packets sent on face_a arrive at face_b (and vice versa) after
the configured delay, subject to loss and bandwidth constraints.
The same LinkConfig is applied in both directions. For asymmetric
links, use pair_asymmetric.
let (face_a, face_b) = SimLink::pair(
FaceId(10), FaceId(11),
LinkConfig::wifi(),
128, // channel buffer size
);Sourcepub fn pair_asymmetric(
id_a: FaceId,
id_b: FaceId,
config_a_to_b: LinkConfig,
config_b_to_a: LinkConfig,
buffer: usize,
) -> (SimFace, SimFace)
pub fn pair_asymmetric( id_a: FaceId, id_b: FaceId, config_a_to_b: LinkConfig, config_b_to_a: LinkConfig, buffer: usize, ) -> (SimFace, SimFace)
Create a pair with different link properties per direction.
config_a_to_b is applied when face_a sends to face_b;
config_b_to_a is applied when face_b sends to face_a.
Auto Trait Implementations§
impl Freeze for SimLink
impl RefUnwindSafe for SimLink
impl Send for SimLink
impl Sync for SimLink
impl Unpin for SimLink
impl UnwindSafe for SimLink
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