pub struct ConsensusState {
pub current_term: u64,
pub voted_for: Option<NodeId>,
pub current_leader: Option<NodeId>,
pub log: Vec<LogEntry>,
pub commit_index: u64,
pub last_applied: u64,
}
Expand description
Consensus algorithm state (simplified Raft)
Fields§
§current_term: u64
§voted_for: Option<NodeId>
§current_leader: Option<NodeId>
§log: Vec<LogEntry>
§commit_index: u64
§last_applied: u64
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConsensusState
impl RefUnwindSafe for ConsensusState
impl Send for ConsensusState
impl Sync for ConsensusState
impl Unpin for ConsensusState
impl UnwindSafe for ConsensusState
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