Enum nebari::tree::PersistenceMode
source · [−]pub enum PersistenceMode {
Transactional(TransactionId),
Sync,
Flush,
}
Expand description
Controls the persistence guarantees of write operations.
Variants
Transactional(TransactionId)
Transactional writes are always fully synchronized, which means that
data written is persisted to the best of the abilities provided by the
operating system hosting Nebari. Additionally, the written data is
tagged as belonging to this Transactionid
.
Sync
Data written is persisted to the best of the abilities provided by the operating system hosting Nebari.
Flush
Data written is not buffered by Nebari, but may still be in operating-system level caches. In the event of a power loss or sudden application failure, the data written may not be available when the tree is reopened. Nebari will automatically recover to the last write that was fully synchronized to disk, but writing using this persistence mode moves the control of synchronization from Nebari to the operating system.
Implementations
sourceimpl PersistenceMode
impl PersistenceMode
sourcepub const fn transaction_id(&self) -> Option<TransactionId>
pub const fn transaction_id(&self) -> Option<TransactionId>
Returns the transaction ID for writes performed with this mode, if applicable.
sourcepub const fn should_synchronize(&self) -> bool
pub const fn should_synchronize(&self) -> bool
Returns true if writes should be fully synchronized before control is returned to the caller.
Trait Implementations
sourceimpl Clone for PersistenceMode
impl Clone for PersistenceMode
sourcefn clone(&self) -> PersistenceMode
fn clone(&self) -> PersistenceMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PersistenceMode
impl Debug for PersistenceMode
sourceimpl From<Option<TransactionId>> for PersistenceMode
impl From<Option<TransactionId>> for PersistenceMode
sourcefn from(maybe_transactional: Option<TransactionId>) -> Self
fn from(maybe_transactional: Option<TransactionId>) -> Self
Performs the conversion.
sourceimpl From<TransactionId> for PersistenceMode
impl From<TransactionId> for PersistenceMode
sourcefn from(id: TransactionId) -> Self
fn from(id: TransactionId) -> Self
Performs the conversion.
sourceimpl PartialEq<PersistenceMode> for PersistenceMode
impl PartialEq<PersistenceMode> for PersistenceMode
sourcefn eq(&self, other: &PersistenceMode) -> bool
fn eq(&self, other: &PersistenceMode) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PersistenceMode) -> bool
fn ne(&self, other: &PersistenceMode) -> bool
This method tests for !=
.
impl Copy for PersistenceMode
impl Eq for PersistenceMode
impl StructuralEq for PersistenceMode
impl StructuralPartialEq for PersistenceMode
Auto Trait Implementations
impl RefUnwindSafe for PersistenceMode
impl Send for PersistenceMode
impl Sync for PersistenceMode
impl Unpin for PersistenceMode
impl UnwindSafe for PersistenceMode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more