pub enum SyncGuarantee {
None,
Ordered,
Durable,
}Expand description
How strong a backend’s Storage::sync actually is — the standing answer to
a Durability request, declared once in Capabilities rather than
discovered per call.
Deliberately three-valued rather than the “can this backend flush?” boolean
it replaces, because that question has a common and useful middle answer it
could not express: a backend that orders writes against each other without
paying for a device-wide cache drain. Offered only true and false, such a
backend has to either overstate — claiming a durability it does not deliver —
or understate, claiming it cannot flush at all when ordering is precisely
what Storage::write_atomic asks it for.
Variants§
None
sync does nothing: an in-memory store, or a port with no flush
primitive under it to call.
Ordered
sync orders writes against each other, but does not promise any of them
outlives a power cut.
Durable
sync flushes through to durable storage.
Implementations§
Source§impl SyncGuarantee
impl SyncGuarantee
Sourcepub const fn satisfies(self, need: Durability) -> bool
pub const fn satisfies(self, need: Durability) -> bool
Whether a backend making this guarantee can honor need.
Trait Implementations§
Source§impl Clone for SyncGuarantee
impl Clone for SyncGuarantee
Source§fn clone(&self) -> SyncGuarantee
fn clone(&self) -> SyncGuarantee
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SyncGuarantee
Source§impl Debug for SyncGuarantee
impl Debug for SyncGuarantee
impl Eq for SyncGuarantee
Source§impl Ord for SyncGuarantee
impl Ord for SyncGuarantee
Source§fn cmp(&self, other: &SyncGuarantee) -> Ordering
fn cmp(&self, other: &SyncGuarantee) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SyncGuarantee
impl PartialEq for SyncGuarantee
Source§impl PartialOrd for SyncGuarantee
impl PartialOrd for SyncGuarantee
impl StructuralPartialEq for SyncGuarantee
Auto Trait Implementations§
impl Freeze for SyncGuarantee
impl RefUnwindSafe for SyncGuarantee
impl Send for SyncGuarantee
impl Sync for SyncGuarantee
impl Unpin for SyncGuarantee
impl UnsafeUnpin for SyncGuarantee
impl UnwindSafe for SyncGuarantee
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.