pub enum PersistenceStrategy {
MemFirst,
}Expand description
Defines how Raft log entries are persisted and accessed.
All strategies use a configurable FlushPolicy to control when memory contents
are flushed to disk, affecting write latency and durability guarantees.
Note: Both strategies now fully load all log entries from disk into memory at startup.
The in-memory SkipMap serves as the primary data structure for reads in all modes.
Variants§
MemFirst
Memory-first persistence strategy.
-
Write path: On append, the log entry is first written to the in-memory
SkipMapand acknowledged immediately. Disk persistence happens asynchronously in the background, governed byFlushPolicy. -
Read path: Reads are always served from the in-memory
SkipMap. -
Startup behavior: All log entries are loaded from disk into memory at startup.
Trait Implementations§
Source§impl Clone for PersistenceStrategy
impl Clone for PersistenceStrategy
Source§fn clone(&self) -> PersistenceStrategy
fn clone(&self) -> PersistenceStrategy
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 PersistenceStrategy
impl Debug for PersistenceStrategy
Source§impl<'de> Deserialize<'de> for PersistenceStrategy
impl<'de> Deserialize<'de> for PersistenceStrategy
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 PersistenceStrategy
impl PartialEq for PersistenceStrategy
Source§fn eq(&self, other: &PersistenceStrategy) -> bool
fn eq(&self, other: &PersistenceStrategy) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PersistenceStrategy
impl Serialize for PersistenceStrategy
impl StructuralPartialEq for PersistenceStrategy
Auto Trait Implementations§
impl Freeze for PersistenceStrategy
impl RefUnwindSafe for PersistenceStrategy
impl Send for PersistenceStrategy
impl Sync for PersistenceStrategy
impl Unpin for PersistenceStrategy
impl UnsafeUnpin for PersistenceStrategy
impl UnwindSafe for PersistenceStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request