pub struct InMemoryTransaction<S: Snapshotable> { /* private fields */ }Expand description
Pure-in-memory transaction. Snapshots the source via
Snapshotable::snapshot on begin, restores via
Snapshotable::restore on rollback.
Implementations§
Source§impl<S: Snapshotable> InMemoryTransaction<S>
impl<S: Snapshotable> InMemoryTransaction<S>
pub fn begin(source: S) -> Self
pub fn active(&self) -> bool
pub fn commit(&mut self) -> TxResult<()>
pub fn rollback(&mut self) -> TxResult<()>
pub fn savepoint(&mut self, name: impl Into<String>) -> TxResult<()>
pub fn release_savepoint(&mut self, name: &str) -> TxResult<()>
pub fn rollback_to(&mut self, name: &str) -> TxResult<()>
Trait Implementations§
Source§impl<S: Snapshotable> Drop for InMemoryTransaction<S>
impl<S: Snapshotable> Drop for InMemoryTransaction<S>
Auto Trait Implementations§
impl<S> Freeze for InMemoryTransaction<S>where
S: Freeze,
Option<<S as Snapshotable>::Snapshot>: Freeze,
BTreeMap<String, <S as Snapshotable>::Snapshot>: Freeze,
impl<S> RefUnwindSafe for InMemoryTransaction<S>where
S: RefUnwindSafe,
Option<<S as Snapshotable>::Snapshot>: RefUnwindSafe,
BTreeMap<String, <S as Snapshotable>::Snapshot>: RefUnwindSafe,
impl<S> Send for InMemoryTransaction<S>where
S: Send,
Option<<S as Snapshotable>::Snapshot>: Send,
BTreeMap<String, <S as Snapshotable>::Snapshot>: Send,
impl<S> Sync for InMemoryTransaction<S>where
S: Sync,
Option<<S as Snapshotable>::Snapshot>: Sync,
BTreeMap<String, <S as Snapshotable>::Snapshot>: Sync,
impl<S> Unpin for InMemoryTransaction<S>where
S: Unpin,
Option<<S as Snapshotable>::Snapshot>: Unpin,
BTreeMap<String, <S as Snapshotable>::Snapshot>: Unpin,
impl<S> UnsafeUnpin for InMemoryTransaction<S>where
S: UnsafeUnpin,
Option<<S as Snapshotable>::Snapshot>: UnsafeUnpin,
BTreeMap<String, <S as Snapshotable>::Snapshot>: UnsafeUnpin,
impl<S> UnwindSafe for InMemoryTransaction<S>where
S: UnwindSafe,
Option<<S as Snapshotable>::Snapshot>: UnwindSafe,
BTreeMap<String, <S as Snapshotable>::Snapshot>: UnwindSafe,
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