pub struct RaftState {
pub current_term: Term,
pub voted_for: Option<NodeId>,
pub commit_index: LogIndex,
pub last_applied: LogIndex,
}Expand description
Persistent state for Raft consensus.
Fields§
§current_term: Term§voted_for: Option<NodeId>§commit_index: LogIndex§last_applied: LogIndexTrait Implementations§
Source§impl<'de> Deserialize<'de> for RaftState
impl<'de> Deserialize<'de> for RaftState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RaftState
impl RefUnwindSafe for RaftState
impl Send for RaftState
impl Sync for RaftState
impl Unpin for RaftState
impl UnsafeUnpin for RaftState
impl UnwindSafe for RaftState
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