pub struct RaftState<NID, N>where
NID: NodeId,
N: Node,{
pub committed: Option<LogId<NID>>,
pub log_ids: LogIdList<NID>,
pub membership_state: MembershipState<NID, N>,
pub snapshot_meta: SnapshotMeta<NID, N>,
pub server_state: ServerState,
/* private fields */
}
Expand description
A struct used to represent the raft state which a Raft node needs.
Fields§
§committed: Option<LogId<NID>>
The LogId of the last log committed(AKA applied) to the state machine.
-
Committed means: a log that is replicated to a quorum of the cluster and it is of the term of the leader.
-
A quorum could be a uniform quorum or joint quorum.
log_ids: LogIdList<NID>
All log ids this node has.
membership_state: MembershipState<NID, N>
The latest cluster membership configuration found, in log or in state machine.
snapshot_meta: SnapshotMeta<NID, N>
The metadata of the last snapshot.
server_state: ServerState
Implementations§
Trait Implementations§
source§impl<NID, N> PartialEq<RaftState<NID, N>> for RaftState<NID, N>where
NID: NodeId + PartialEq,
N: Node + PartialEq,
impl<NID, N> PartialEq<RaftState<NID, N>> for RaftState<NID, N>where NID: NodeId + PartialEq, N: Node + PartialEq,
impl<NID, N> Eq for RaftState<NID, N>where NID: NodeId + Eq, N: Node + Eq,
impl<NID, N> StructuralEq for RaftState<NID, N>where NID: NodeId, N: Node,
impl<NID, N> StructuralPartialEq for RaftState<NID, N>where NID: NodeId, N: Node,
Auto Trait Implementations§
impl<NID, N> RefUnwindSafe for RaftState<NID, N>where N: RefUnwindSafe, NID: RefUnwindSafe,
impl<NID, N> Send for RaftState<NID, N>
impl<NID, N> Sync for RaftState<NID, N>
impl<NID, N> Unpin for RaftState<NID, N>where NID: Unpin,
impl<NID, N> UnwindSafe for RaftState<NID, N>where N: RefUnwindSafe, NID: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.