pub struct RaftState<NID, N, I>{
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
The state of a Raft node, such as Leader or Follower.
Implementations§
Trait Implementations§
source§impl<NID, N, I> PartialEq for RaftState<NID, N, I>
impl<NID, N, I> PartialEq for RaftState<NID, N, I>
impl<NID, N, I> Eq for RaftState<NID, N, I>
impl<NID, N, I> StructuralPartialEq for RaftState<NID, N, I>
Auto Trait Implementations§
impl<NID, N, I> Freeze for RaftState<NID, N, I>
impl<NID, N, I> RefUnwindSafe for RaftState<NID, N, I>where
NID: RefUnwindSafe,
N: RefUnwindSafe,
impl<NID, N, I> Send for RaftState<NID, N, I>
impl<NID, N, I> Sync for RaftState<NID, N, I>
impl<NID, N, I> Unpin for RaftState<NID, N, I>where
NID: Unpin,
impl<NID, N, I> UnwindSafe for RaftState<NID, N, I>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more