pub struct Txn { /* private fields */ }Expand description
An open transaction: the backups exist and the marker names this
process. Dropping it without commit restores both files.
Implementations§
Source§impl Txn
impl Txn
Sourcepub fn commit(self) -> Result<(), FinishFailure>
pub fn commit(self) -> Result<(), FinishFailure>
Keep the new contents and finish the transaction.
§Errors
The finishing failure: the marker could be neither neutralized nor removed, so it is still active beside its backups, and the caller must name it, because the next recovery would roll the finished bump back.
Sourcepub fn abort(self) -> Result<Vec<String>, AbortFailure>
pub fn abort(self) -> Result<Vec<String>, AbortFailure>
Put both files back and finish the transaction; the names restored.
§Errors
Where a file cannot be put back, the marker and the backups stay active for the next run’s recovery. Where the files are back and the marker cannot be finished, the error says so: an active marker beside its backups would overwrite later edits on the next recovery.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Txn
impl RefUnwindSafe for Txn
impl Send for Txn
impl Sync for Txn
impl Unpin for Txn
impl UnsafeUnpin for Txn
impl UnwindSafe for Txn
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