#[non_exhaustive]pub enum Durability {
Synced,
Unsynced,
}Expand description
Whether a created archive is flushed to stable storage before it is reported as written.
Synced (the default) flushes the archive file and then its parent
directory entry, so a published archive survives a crash or power
loss.
Unsynced skips both flushes and is faster, with these hazards:
- After a crash or power loss a
Replacetarget can be empty or truncated, and aCreateNewfile can be empty. - Write-back errors (network filesystems, quotas, delayed-allocation
ENOSPC) are not reported, so anOkresult does not mean the bytes reached the disk.
§Examples
use exarch_core::Durability;
use exarch_core::OutputFile;
assert_eq!(Durability::default(), Durability::Synced);
let out = OutputFile::replace("scratch.tar").with_durability(Durability::Unsynced);
assert_eq!(out.durability(), Durability::Unsynced);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Synced
Flush the file and its directory entry before reporting success
Unsynced
Skip the flushes; see the type documentation for the hazards
Implementations§
Source§impl Durability
impl Durability
Trait Implementations§
Source§impl Clone for Durability
impl Clone for Durability
Source§impl ClosedEnum for Durability
impl ClosedEnum for Durability
impl Copy for Durability
Source§impl Debug for Durability
impl Debug for Durability
Source§impl Default for Durability
impl Default for Durability
Source§impl Display for Durability
impl Display for Durability
impl Eq for Durability
Source§impl Hash for Durability
impl Hash for Durability
Source§impl PartialEq for Durability
impl PartialEq 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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.