Struct nebari::ExecutingTransaction
source · [−]pub struct ExecutingTransaction<File: ManagedFile> { /* private fields */ }
Expand description
An executing transaction. While this exists, no other transactions can execute across the same trees as this transaction holds.
Implementations
sourceimpl<File: ManagedFile> ExecutingTransaction<File>
impl<File: ManagedFile> ExecutingTransaction<File>
sourcepub fn entry_mut(&mut self) -> &mut LogEntry<'static>
pub fn entry_mut(&mut self) -> &mut LogEntry<'static>
Returns a mutable reference to the LogEntry
for this transaction.
sourcepub fn commit(self) -> Result<(), Error>
pub fn commit(self) -> Result<(), Error>
Commits the transaction. Once this function has returned, all data updates are guaranteed to be able to be accessed by all other readers as well as impervious to sudden failures such as a power outage.
sourcepub fn rollback(self)
pub fn rollback(self)
Rolls the transaction back. It is not necessary to call this function –
transactions will automatically be rolled back when the transaction is
dropped, if commit()
isn’t called first.
sourcepub fn tree<Root: Root>(
&self,
index: usize
) -> Option<LockedTransactionTree<'_, Root, File>>
pub fn tree<Root: Root>(
&self,
index: usize
) -> Option<LockedTransactionTree<'_, Root, File>>
Accesses a locked tree.
sourcepub fn unlocked_tree(
&self,
index: usize
) -> Option<&UnlockedTransactionTree<File>>
pub fn unlocked_tree(
&self,
index: usize
) -> Option<&UnlockedTransactionTree<File>>
Accesses an unlocked tree. Note: If you clone an
UnlockedTransactionTree
, you must make sure to drop all instances
before calling commit.
Trait Implementations
sourceimpl<File: ManagedFile> Drop for ExecutingTransaction<File>
impl<File: ManagedFile> Drop for ExecutingTransaction<File>
Auto Trait Implementations
impl<File> !RefUnwindSafe for ExecutingTransaction<File>
impl<File> Send for ExecutingTransaction<File>
impl<File> Sync for ExecutingTransaction<File>
impl<File> Unpin for ExecutingTransaction<File> where
<File as ManagedFile>::Manager: Unpin,
impl<File> !UnwindSafe for ExecutingTransaction<File>
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> 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