pub struct SaveOptions {
pub durable: bool,
}Expand description
Durability policy for one path save.
Every path save writes a temporary file (prefix .sheetkit-) in the
destination directory and renames it over the destination. A failed save
or an application crash before the rename leaves the previous file intact;
a hard kill can leave an orphan temporary file behind.
durable: false(default): no flush is requested. After a power loss or operating-system crash shortly after a successful save, the destination may hold the previous version, the new one, or, depending on the file system and mount options, an empty or incomplete file.durable: true: the temporary file is flushed to storage before the rename (fsync;F_FULLFSYNCon macOS, which costs several milliseconds;FlushFileBufferson Windows), and on Unix the parent directory is synced after the rename. A failed directory sync returnsError::Iostating that the new file is already in place. Windows has no directory sync, so that step is skipped there.
Network file systems and drives that ignore flush requests can weaken
either guarantee. Construct it with a struct literal or
SaveOptions::default().
Fields§
§durable: boolFlush the file and its directory entry to storage before returning.
Trait Implementations§
Source§impl Clone for SaveOptions
impl Clone for SaveOptions
Source§fn clone(&self) -> SaveOptions
fn clone(&self) -> SaveOptions
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 SaveOptions
Source§impl Debug for SaveOptions
impl Debug for SaveOptions
Source§impl Default for SaveOptions
impl Default for SaveOptions
Source§fn default() -> SaveOptions
fn default() -> SaveOptions
Returns the “default value” for a type. Read more
impl Eq for SaveOptions
Source§impl PartialEq for SaveOptions
impl PartialEq for SaveOptions
impl StructuralPartialEq for SaveOptions
Auto Trait Implementations§
impl Freeze for SaveOptions
impl RefUnwindSafe for SaveOptions
impl Send for SaveOptions
impl Sync for SaveOptions
impl Unpin for SaveOptions
impl UnsafeUnpin for SaveOptions
impl UnwindSafe for SaveOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.