pub struct InstallSnapshot {
pub term: Term,
pub leader: NodeId,
pub snapshot: Snapshot,
}Expand description
A leader’s transfer of a Snapshot to a follower too far behind to
replicate entry by entry.
When a follower’s next required entry has already been compacted out of the
leader’s log, the leader sends this instead of an AppendEntries. The
follower installs the snapshot — replacing its state through
snapshot.index — then resumes normal replication from the tail.
§Examples
use raft_io::{InstallSnapshot, Snapshot};
let rpc = InstallSnapshot { term: 5, leader: 1, snapshot: Snapshot::new(10, 3, vec![]) };
assert_eq!(rpc.snapshot.index, 10);Fields§
§term: TermThe leader’s term.
leader: NodeIdThe leader sending the snapshot.
snapshot: SnapshotThe snapshot to install.
Trait Implementations§
Source§impl Clone for InstallSnapshot
impl Clone for InstallSnapshot
Source§fn clone(&self) -> InstallSnapshot
fn clone(&self) -> InstallSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InstallSnapshot
impl Debug for InstallSnapshot
Source§impl Deserialize for InstallSnapshot
impl Deserialize for InstallSnapshot
impl Eq for InstallSnapshot
Source§impl PartialEq for InstallSnapshot
impl PartialEq for InstallSnapshot
Source§fn eq(&self, other: &InstallSnapshot) -> bool
fn eq(&self, other: &InstallSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for InstallSnapshot
impl Serialize for InstallSnapshot
impl StructuralPartialEq for InstallSnapshot
Auto Trait Implementations§
impl Freeze for InstallSnapshot
impl RefUnwindSafe for InstallSnapshot
impl Send for InstallSnapshot
impl Sync for InstallSnapshot
impl Unpin for InstallSnapshot
impl UnsafeUnpin for InstallSnapshot
impl UnwindSafe for InstallSnapshot
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