ExecutingTransaction

Struct 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§

Source§

impl<File: ManagedFile> ExecutingTransaction<File>

Source

pub fn entry(&self) -> &LogEntry<'static>

Returns the LogEntry for this transaction.

Source

pub fn entry_mut(&mut self) -> &mut LogEntry<'static>

Returns a mutable reference to the LogEntry for this transaction.

Source

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.

Source

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.

Source

pub fn tree<Root: Root>( &self, index: usize, ) -> Option<LockedTransactionTree<'_, Root, File>>

Accesses a locked tree.

Source

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§

Source§

impl<File: ManagedFile> Drop for ExecutingTransaction<File>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<File> Freeze for ExecutingTransaction<File>
where <File as ManagedFile>::Manager: Freeze,

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.