pub struct HardState {
pub current_term: Term,
pub voted_for: Option<NodeId>,
}Expand description
The persistent state a node restarts with: its hard state and its durable log entries, exactly as the storage layer recovered them.
Fields§
§current_term: TermThe latest term the node had seen before the crash.
voted_for: Option<NodeId>The candidate the node voted for in current_term, if any.
Trait Implementations§
impl Eq for HardState
impl StructuralPartialEq for HardState
Auto Trait Implementations§
impl Forget for HardState
impl Freeze for HardState
impl Move for HardState
impl RefUnwindSafe for HardState
impl Send for HardState
impl Sync for HardState
impl Unpin for HardState
impl UnsafeUnpin for HardState
impl UnwindSafe for HardState
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