Struct almost_raft::election::RaftElectionState[][src]

pub struct RaftElectionState<T> { /* fields omitted */ }
Expand description

Current state of the Raft

Implementations

Initiate Raft election. This method doesn’t start the election.

Arguments

  • self_id - Identifier of this node
  • election_timeout - Time between the elections if no heartbeat is received. Will use a randomized value in range [election_timeout..election_timeout*2]
  • heartbeat_interval - Interval between heartbeat message
  • message_timeout - Timout before treating message sending as failure
  • peers - other nodes
  • tx - MPSC Sender to communicate with outside. Control messages will use this channel
  • max_node - Maximum number of allowed node in the cluster
  • min_node - Minimum node required. Election will not start until number of node reach min_node

Returns

Tuple - the initialized RaftElectionState & a Sender of mpsc channel for incoming control messages

Trait Implementations

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

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.