pub struct LazyTransaction<S, T>(/* private fields */)
where
S: BlockStorage + Clone + 'static,
T: Transactionable<S> + 'static;Expand description
Lazy transaction that only opens the transaction when used.
Implementations§
Source§impl<S, T> LazyTransaction<S, T>
impl<S, T> LazyTransaction<S, T>
pub fn new(storage: S, init: T) -> Self
Sourcepub fn is_mut_access(&self) -> bool
pub fn is_mut_access(&self) -> bool
Whether this transaction has been accessed mutable yet.
pub async fn get(&mut self) -> Result<&T::Transaction, StorageError>
pub async fn get_mut(&mut self) -> Result<&mut T::Transaction, StorageError>
pub fn opt(&self) -> Option<&T::Transaction>
pub fn opt_mut(&mut self) -> Option<&mut T::Transaction>
pub fn opt_if_is_mut_access(&mut self) -> Option<&mut T::Transaction>
Trait Implementations§
Source§impl<S, T> Debug for LazyTransaction<S, T>where
S: BlockStorage + Clone + 'static + Debug,
T: Transactionable<S> + 'static + Debug,
T::Transaction: Debug,
impl<S, T> Debug for LazyTransaction<S, T>where
S: BlockStorage + Clone + 'static + Debug,
T: Transactionable<S> + 'static + Debug,
T::Transaction: Debug,
Auto Trait Implementations§
impl<S, T> Freeze for LazyTransaction<S, T>
impl<S, T> RefUnwindSafe for LazyTransaction<S, T>
impl<S, T> Send for LazyTransaction<S, T>
impl<S, T> Sync for LazyTransaction<S, T>
impl<S, T> Unpin for LazyTransaction<S, T>
impl<S, T> UnsafeUnpin for LazyTransaction<S, T>
impl<S, T> UnwindSafe for LazyTransaction<S, T>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more