Struct persy::TransactionFinalize
source · [−]pub struct TransactionFinalize { /* private fields */ }
Expand description
prepared transaction state
Implementations
sourceimpl TransactionFinalize
impl TransactionFinalize
sourcepub fn rollback(self) -> Result<(), PE<GenericError>>
pub fn rollback(self) -> Result<(), PE<GenericError>>
Rollback a prepared commit.
All the modification are rolled back and all the used resources are put released
Example
let mut tx = persy.begin()?;
//Do what ever operations on the records
let data = vec![1;20];
tx.insert("seg", &data)?;
let prepared = tx.prepare()?;
prepared.rollback()?;
sourcepub fn commit(self) -> Result<(), PE<GenericError>>
pub fn commit(self) -> Result<(), PE<GenericError>>
Finalize the commit result of a prepared commit.
All the operation done on the transaction are finalized all the lock released, all the old resources are released for reuse.
Example
let mut tx = persy.begin()?;
let prepared = tx.prepare()?;
prepared.commit()?;
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for TransactionFinalize
impl Send for TransactionFinalize
impl Sync for TransactionFinalize
impl Unpin for TransactionFinalize
impl !UnwindSafe for TransactionFinalize
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more