pub struct TransactionEngine { /* private fields */ }Implementations§
Source§impl TransactionEngine
impl TransactionEngine
Sourcepub fn apply<F>(
self,
plan: &WritePlan,
options: &TransactionOptions,
doctor: F,
) -> Result<TransactionResult, TransactionError>
pub fn apply<F>( self, plan: &WritePlan, options: &TransactionOptions, doctor: F, ) -> Result<TransactionResult, TransactionError>
Applies a write plan atomically enough to restore all touched files on failure.
§Errors
Returns an error for conflicts, locks, unsafe paths, I/O failure, or failed doctor.
Sourcepub fn rollback(
self,
snapshot_id: SnapshotId,
options: &TransactionOptions,
) -> Result<(), TransactionError>
pub fn rollback( self, snapshot_id: SnapshotId, options: &TransactionOptions, ) -> Result<(), TransactionError>
Restores every file recorded by a transaction snapshot.
§Errors
Returns an error when the snapshot is absent, invalid, locked, or cannot be restored.
Trait Implementations§
Source§impl Clone for TransactionEngine
impl Clone for TransactionEngine
impl Copy for TransactionEngine
Source§impl Debug for TransactionEngine
impl Debug for TransactionEngine
Auto Trait Implementations§
impl Freeze for TransactionEngine
impl RefUnwindSafe for TransactionEngine
impl Send for TransactionEngine
impl Sync for TransactionEngine
impl Unpin for TransactionEngine
impl UnsafeUnpin for TransactionEngine
impl UnwindSafe for TransactionEngine
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