pub enum DurabilityTier {
Memory,
Lossy,
Soft,
Strong,
}Expand description
Durability tier from @store(durability:).
Monotonically increasing in cost and decreasing in crash-loss window. See the design doc for the per-tier semantics and the crash-loss windows.
Variants§
Memory
"memory" — BackendType::InMemory, nothing survives restart.
Lossy
"lossy" — RocksDB with WAL disabled (disable_wal = true).
Survives clean restart; loses up to a memtable flush window
(~minutes) on crash.
Soft
"soft" — RocksDB with WAL on, OS-controlled fsync
(sync_writes = false). Survives crash; loses ~seconds on
power-loss. RocksDB default.
Strong
"strong" — RocksDB with WAL on + WriteOptions::sync = true
(per-write fsync). Zero loss; full cost.
Implementations§
Source§impl DurabilityTier
impl DurabilityTier
Sourcepub const fn backend_type(self) -> BackendType
pub const fn backend_type(self) -> BackendType
The BackendType this tier maps to.
Sourcepub const fn requires_wal(self) -> bool
pub const fn requires_wal(self) -> bool
Whether this tier requires the WAL to be enabled at backend
open time. Memory has nothing to write to; Lossy opts out;
Soft + Strong need WAL on.
Sourcepub const fn sync_writes(self) -> bool
pub const fn sync_writes(self) -> bool
Whether this tier requests per-write fsync via
WriteOptions::sync = true. Only Strong does.
Trait Implementations§
Source§impl Clone for DurabilityTier
impl Clone for DurabilityTier
Source§fn clone(&self) -> DurabilityTier
fn clone(&self) -> DurabilityTier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DurabilityTier
Source§impl Debug for DurabilityTier
impl Debug for DurabilityTier
Source§impl Default for DurabilityTier
impl Default for DurabilityTier
Source§impl<'de> Deserialize<'de> for DurabilityTier
impl<'de> Deserialize<'de> for DurabilityTier
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>,
impl Eq for DurabilityTier
Source§impl Hash for DurabilityTier
impl Hash for DurabilityTier
Source§impl Ord for DurabilityTier
impl Ord for DurabilityTier
Source§fn cmp(&self, other: &DurabilityTier) -> Ordering
fn cmp(&self, other: &DurabilityTier) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for DurabilityTier
impl PartialEq for DurabilityTier
Source§fn eq(&self, other: &DurabilityTier) -> bool
fn eq(&self, other: &DurabilityTier) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for DurabilityTier
impl PartialOrd for DurabilityTier
Source§impl Serialize for DurabilityTier
impl Serialize for DurabilityTier
impl StructuralPartialEq for DurabilityTier
Auto Trait Implementations§
impl Freeze for DurabilityTier
impl RefUnwindSafe for DurabilityTier
impl Send for DurabilityTier
impl Sync for DurabilityTier
impl Unpin for DurabilityTier
impl UnsafeUnpin for DurabilityTier
impl UnwindSafe for DurabilityTier
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.