pub struct Party { /* private fields */ }
Expand description

A Party that takes part in a protocol. The party has a unique id and is pre-loaded with communication channels to and from all the other parties. A party keeps track of its own stats.

Implementations

Blocks until this party receives a message from the party with from_id. A message is a vector of bytes Vec<u8>. This can be achieved for example using bincode serialization.

Sends a vector of bytes to the party with to_id and keeps track of the number of bits sent to this party.

Broadcasts a message (a vector of bytes) to all parties and keeps track of the number of bits sent.

Creates a timer with the given name that starts running immediately.

Stops the timer and writes it measured duration to this party’s statistics.

Gets the collected statistics for this party.

Sets an actual name for a party to make the stats easier to interpret.

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.