pub enum FsyncPolicy {
Always,
Periodic(Duration),
Never,
}Expand description
How aggressively the persistence layer fsyncs to durable storage.
Snapshot saves honor Always and Never (and treat Periodic as
Always, since a snapshot is a single write). For WAL appends,
Periodic(interval) fsyncs no more than once per interval,
trading a bounded window of un-fsynced tail records for throughput.
§Examples
use iqdb_persist::FsyncPolicy;
use std::time::Duration;
let _ = FsyncPolicy::Always;
let _ = FsyncPolicy::Periodic(Duration::from_secs(1));
let _ = FsyncPolicy::Never;Variants§
Always
fsync every write.
Periodic(Duration)
fsync no more often than this interval (governs WAL appends).
Never
Never fsync. Fastest, weakest durability — appropriate for tests and tmpfs-backed paths only.
Trait Implementations§
Source§impl Clone for FsyncPolicy
impl Clone for FsyncPolicy
Source§fn clone(&self) -> FsyncPolicy
fn clone(&self) -> FsyncPolicy
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 moreimpl Copy for FsyncPolicy
Source§impl Debug for FsyncPolicy
impl Debug for FsyncPolicy
Source§impl<'de> Deserialize<'de> for FsyncPolicy
impl<'de> Deserialize<'de> for FsyncPolicy
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
impl Eq for FsyncPolicy
Source§impl PartialEq for FsyncPolicy
impl PartialEq for FsyncPolicy
Source§fn eq(&self, other: &FsyncPolicy) -> bool
fn eq(&self, other: &FsyncPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FsyncPolicy
impl Serialize for FsyncPolicy
impl StructuralPartialEq for FsyncPolicy
Auto Trait Implementations§
impl Freeze for FsyncPolicy
impl RefUnwindSafe for FsyncPolicy
impl Send for FsyncPolicy
impl Sync for FsyncPolicy
impl Unpin for FsyncPolicy
impl UnsafeUnpin for FsyncPolicy
impl UnwindSafe for FsyncPolicy
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