pub enum Durability {
Fsync,
Relaxed,
}Expand description
How much a commit promises, which is a semantic choice rather than a tuning knob.
03 §3.7 makes the log the only description of
a program’s history, so “an accepted event may be lost” is a change to what the system means and
not a setting. It is therefore named, defaulted to the strong option, and measured
(docs/67 §67.3) — because the cost of the strong option is 38× and a number that large deserves
to be visible rather than discovered.
Variants§
Fsync
synchronous = FULL: every commit is on the platter before it is acknowledged.
The same promise redb and Postgres make, which is what makes them comparable.
Relaxed
synchronous = NORMAL under WAL: a commit survives a process crash and may be lost in a
power loss. Not corrupted — WAL rules that out — but an acknowledged event can vanish.
Legitimate for a laptop where the log is a scratchpad, and never the default, because a weaker promise arrived at by not reading a manual is not a decision anybody made.
Trait Implementations§
Source§impl Clone for Durability
impl Clone for Durability
Source§fn clone(&self) -> Durability
fn clone(&self) -> Durability
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Durability
impl Debug for Durability
Source§impl Default for Durability
impl Default for Durability
Source§fn default() -> Durability
fn default() -> Durability
Source§impl PartialEq for Durability
impl PartialEq for Durability
impl Copy for Durability
impl Eq for Durability
impl StructuralPartialEq for Durability
Auto Trait Implementations§
impl Freeze for Durability
impl RefUnwindSafe for Durability
impl Send for Durability
impl Sync for Durability
impl Unpin for Durability
impl UnwindSafe for Durability
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.