Struct madsim::net::NetSim

source ·
pub struct NetSim { /* private fields */ }
Available on madsim only.
Expand description

Network simulator.

Implementations§

Get NetSim of the current simulator.

Get the statistics.

Update network configurations.

Reset a node.

All connections will be closed.

Set IP address of a node.

👎Deprecated since 0.3.0: use unclog_node instead

Connect a node to the network.

Unclog the node.

Unclog the node for receive.

Unclog the node for send.

👎Deprecated since 0.3.0: use clog_node instead

Disconnect a node from the network.

Clog the node.

Clog the node for receive.

Clog the node for send.

👎Deprecated since 0.3.0: call unclog_link twice instead

Connect a pair of nodes.

Unclog the link from src to dst.

👎Deprecated since 0.3.0: call clog_link twice instead

Disconnect a pair of nodes.

Clog the link from src to dst.

Available on crate feature rpc only.

Add a hook function for RPC requests.

If the hook function returns false, the request will be dropped.

Available on crate feature rpc only.

Add a hook function for RPC responses.

If the hook function returns false, the response will be dropped.

Trait Implementations§

Available on madsim only.
Create a new simulator. Read more
Available on madsim only.
Create a node.
Available on madsim only.
Reset a node.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
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.
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more