pub struct WriteOptions {
pub fsync: bool,
}Expand description
Options controlling how a write touches the filesystem.
Default values match the previous (pre-Phase-A) std::fs::write
behaviour: atomic at the rename, but not durable against power loss.
Set fsync: true to force the data to stable storage before the
write returns.
Designed to be Copy + Default + serde::* so it can be piped through
the mutation builders, configured from env vars or config files, or
surfaced over a Tauri command.
Fields§
§fsync: boolfsync the temp file’s data, then fsync the parent directory’s metadata, before considering the write complete. Adds one or two disk-flush IOs per write — typically 1–10ms on consumer SSDs and 10–50ms on spinning disks. Required for durable mutations (e.g. a long-lived Tauri app) that need to survive sudden power loss with the change preserved.
Implementations§
Source§impl WriteOptions
impl WriteOptions
Trait Implementations§
Source§impl Clone for WriteOptions
impl Clone for WriteOptions
Source§fn clone(&self) -> WriteOptions
fn clone(&self) -> WriteOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WriteOptions
impl Debug for WriteOptions
Source§impl Default for WriteOptions
impl Default for WriteOptions
Source§fn default() -> WriteOptions
fn default() -> WriteOptions
Source§impl<'de> Deserialize<'de> for WriteOptions
impl<'de> Deserialize<'de> for WriteOptions
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>,
Source§impl PartialEq for WriteOptions
impl PartialEq for WriteOptions
Source§fn eq(&self, other: &WriteOptions) -> bool
fn eq(&self, other: &WriteOptions) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for WriteOptions
impl Serialize for WriteOptions
impl Copy for WriteOptions
impl Eq for WriteOptions
impl StructuralPartialEq for WriteOptions
Auto Trait Implementations§
impl Freeze for WriteOptions
impl RefUnwindSafe for WriteOptions
impl Send for WriteOptions
impl Sync for WriteOptions
impl Unpin for WriteOptions
impl UnsafeUnpin for WriteOptions
impl UnwindSafe for WriteOptions
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> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.