pub struct NetSim { /* private fields */ }Available on
madsim only.Expand description
Network simulator.
Implementations§
source§impl NetSim
impl NetSim
sourcepub fn update_config(&self, f: impl FnOnce(&mut Config))
pub fn update_config(&self, f: impl FnOnce(&mut Config))
Update network configurations.
sourcepub fn reset_node(&self, id: NodeId)
pub fn reset_node(&self, id: NodeId)
Reset a node.
All connections will be closed.
sourcepub fn connect(&self, id: NodeId)
👎Deprecated since 0.3.0: use unclog_node instead
pub fn connect(&self, id: NodeId)
unclog_node insteadConnect a node to the network.
sourcepub fn unclog_node(&self, id: NodeId)
pub fn unclog_node(&self, id: NodeId)
Unclog the node.
sourcepub fn unclog_node_in(&self, id: NodeId)
pub fn unclog_node_in(&self, id: NodeId)
Unclog the node for receive.
sourcepub fn unclog_node_out(&self, id: NodeId)
pub fn unclog_node_out(&self, id: NodeId)
Unclog the node for send.
sourcepub fn disconnect(&self, id: NodeId)
👎Deprecated since 0.3.0: use clog_node instead
pub fn disconnect(&self, id: NodeId)
clog_node insteadDisconnect a node from the network.
sourcepub fn clog_node_in(&self, id: NodeId)
pub fn clog_node_in(&self, id: NodeId)
Clog the node for receive.
sourcepub fn clog_node_out(&self, id: NodeId)
pub fn clog_node_out(&self, id: NodeId)
Clog the node for send.
sourcepub fn connect2(&self, node1: NodeId, node2: NodeId)
👎Deprecated since 0.3.0: call unclog_link twice instead
pub fn connect2(&self, node1: NodeId, node2: NodeId)
unclog_link twice insteadConnect a pair of nodes.
sourcepub fn unclog_link(&self, src: NodeId, dst: NodeId)
pub fn unclog_link(&self, src: NodeId, dst: NodeId)
Unclog the link from src to dst.
sourcepub fn disconnect2(&self, node1: NodeId, node2: NodeId)
👎Deprecated since 0.3.0: call clog_link twice instead
pub fn disconnect2(&self, node1: NodeId, node2: NodeId)
clog_link twice insteadDisconnect a pair of nodes.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for NetSim
impl Send for NetSim
impl Sync for NetSim
impl Unpin for NetSim
impl !UnwindSafe for NetSim
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.