pub struct Persist {
pub term: Term,
pub voted_for: Option<NodeId>,
pub hard_state_dirty: bool,
pub truncate_from: Option<LogIndex>,
pub entries: Vec<LogEntry>,
}Expand description
A batch of durable state changes an outer runtime must fsync before
acting on any network effect drained from the same step (Raft §5.1–§5.3):
a follower persists appended entries before ack’ing them, and a node
persists its term/vote before replying to a vote. Produced by
RaftNode::take_persist; it is the delta since the previous call.
Fields§
§term: TermCurrent term to record in the hard state.
voted_for: Option<NodeId>Vote cast in term, to record in the hard state.
hard_state_dirty: boolWhether the hard state (term/voted_for) actually changed and must be
written; false means only the log changed this step.
truncate_from: Option<LogIndex>When set, the persisted log suffix at indices >= from must be
truncated before entries are appended (conflict resolution, Raft §5.3).
entries: Vec<LogEntry>Entries to append after any truncation (ascending, contiguous).
Trait Implementations§
impl Eq for Persist
impl StructuralPartialEq for Persist
Auto Trait Implementations§
impl Freeze for Persist
impl RefUnwindSafe for Persist
impl Send for Persist
impl Sync for Persist
impl Unpin for Persist
impl UnsafeUnpin for Persist
impl UnwindSafe for Persist
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