Struct turmoil::Sim

source ·
pub struct Sim<'a> { /* private fields */ }
Expand description

Network simulation

Implementations

Register a client with the simulation.

Register a host with the simulation.

This method takes a Fn that builds a future, as opposed to Sim::client which just takes a future. The reason for this is we might restart the host, and so need to be able to call the future multiple times.

Crash a host. Nothing will be running on the host after this method. You can use Sim::bounce to start the host up again.

Bounce a host. The software is restarted.

Lookup an ip address by host name.

Set the max message latency

Set the message latency distribution curve.

Message latency follows an exponential distribution curve. The value is the lambda argument to the probability function.

Run the simulation until all clients finish.

For each runtime, we [Rt::tick] it forward, which allows time to advance just a little bit. In this way, only one runtime is ever active. The turmoil APIs operate on the active host, and so we remember which host is active before yielding to user code.

If any client errors, the simulation returns early with that Error.

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

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