Enum openraft::SnapshotPolicy
source · pub enum SnapshotPolicy {
LogsSinceLast(u64),
Never,
}
Expand description
Log compaction and snapshot policy.
This governs when periodic snapshots will be taken, and also governs the conditions which
would cause a leader to send an InstallSnapshot
RPC to a follower based on replication lag.
Additional policies may become available in the future.
Variants§
LogsSinceLast(u64)
A snapshot will be generated once the log has grown the specified number of logs since the last snapshot.
Never
Openraft will never trigger a snapshot building.
With this option, the application calls
Raft::trigger_snapshot()
to manually trigger a
snapshot.
Trait Implementations§
source§impl Clone for SnapshotPolicy
impl Clone for SnapshotPolicy
source§fn clone(&self) -> SnapshotPolicy
fn clone(&self) -> SnapshotPolicy
Returns a copy of the value. Read more
1.0.0 · 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 SnapshotPolicy
impl Debug for SnapshotPolicy
source§impl<'de> Deserialize<'de> for SnapshotPolicy
impl<'de> Deserialize<'de> for SnapshotPolicy
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
source§impl PartialEq for SnapshotPolicy
impl PartialEq for SnapshotPolicy
source§fn eq(&self, other: &SnapshotPolicy) -> bool
fn eq(&self, other: &SnapshotPolicy) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for SnapshotPolicy
impl Serialize for SnapshotPolicy
impl Eq for SnapshotPolicy
impl StructuralPartialEq for SnapshotPolicy
Auto Trait Implementations§
impl Freeze for SnapshotPolicy
impl RefUnwindSafe for SnapshotPolicy
impl Send for SnapshotPolicy
impl Sync for SnapshotPolicy
impl Unpin for SnapshotPolicy
impl UnwindSafe for SnapshotPolicy
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