[−][src]Struct actix_raft::messages::InstallSnapshotRequest
Invoked by the Raft leader to send chunks of a snapshot to a follower (§7).
actix::Message
Applications using this Raft implementation are responsible for implementing the
networking/transport layer which must move RPCs between nodes. Once the application instance
recieves a Raft RPC, it must send the RPC to the Raft node via its actix::Addr
and then
return the response to the original sender.
The result type of calling the Raft actor with this message type is
Result<InstallSnapshotResponse, ()>
. The Raft spec assigns no significance to failures during
the handling or sending of RPCs and all RPCs are handled in an idempotent fashion, so Raft will
almost always retry sending a failed RPC, depending on the state of the Raft.
Fields
target: u64
A non-standard field, this is the ID of the intended recipient of this RPC.
term: u64
The leader's current term.
leader_id: u64
The leader's ID. Useful in redirecting clients.
last_included_index: u64
The snapshot replaces all log entries up through and including this index.
last_included_term: u64
The term of the last_included_index
.
offset: u64
The byte offset where chunk is positioned in the snapshot file.
data: Vec<u8>
The raw Vecoffset
.
done: bool
Will be true
if this is the last chunk in the snapshot.
Trait Implementations
impl Clone for InstallSnapshotRequest
[src]
fn clone(&self) -> InstallSnapshotRequest
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for InstallSnapshotRequest
[src]
impl<'de> Deserialize<'de> for InstallSnapshotRequest
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<D: AppData, R: AppDataResponse, E: AppError, N: RaftNetwork<D>, S: RaftStorage<D, R, E>> Handler<InstallSnapshotRequest> for Raft<D, R, E, N, S>
[src]
type Result = ResponseActFuture<Self, InstallSnapshotResponse, ()>
The type of value that this handler will return.
fn handle(
&mut self,
msg: InstallSnapshotRequest,
ctx: &mut Self::Context
) -> Self::Result
[src]
&mut self,
msg: InstallSnapshotRequest,
ctx: &mut Self::Context
) -> Self::Result
Invoked by leader to send chunks of a snapshot to a follower (§7).
Leaders always send chunks in order. It is important to note that, according to the Raft spec, a log may only have one snapshot at any time. As snapshot contents are application specific, the Raft log will only store a pointer to the snapshot file along with the index & term.
See the storage::InstallSnapshot
type for implementaion details.
impl Message for InstallSnapshotRequest
[src]
type Result = Result<InstallSnapshotResponse, ()>
The result type of this message.
The Result::Err
type is ()
as Raft assigns no significance to RPC failures, they will
almost always be retried as long as permitted by the current state of the Raft.
impl Serialize for InstallSnapshotRequest
[src]
Auto Trait Implementations
impl RefUnwindSafe for InstallSnapshotRequest
impl Send for InstallSnapshotRequest
impl Sync for InstallSnapshotRequest
impl Unpin for InstallSnapshotRequest
impl UnwindSafe for InstallSnapshotRequest
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,