pub struct Simulation<T>where
    T: StateMachine,
{ /* private fields */ }
Expand description

A peer-to-peer node simulation.

Implementations

Create a new simulation.

Check whether the simulation is done, ie. there are no more messages to process.

Total amount of simulated time elapsed.

Check whether the simulation has settled, ie. the only messages left to process are (periodic) timeouts.

Get a node’s emitted events.

Get the latency between two nodes. The minimum latency between nodes is 1 millisecond.

Initialize peers.

Run the simulation while the given predicate holds.

Process one scheduled input from the inbox, using the provided peers. This function should be called until it returns false, or some desired state is reached. Returns true if there are more messages to process.

Process a protocol output event from 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

Returns the argument unchanged.

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.