[][src]Struct persy::Recover

pub struct Recover { /* fields omitted */ }

Intermediate recover status to select witch transactions to commit or rollback and list witch transactions are in a intermediate state


let mut recover = Persy::recover("./recover_example.persy", Config::new())?;
for (tx_id,status) in recover.list_transactions()? {
    // Check the transaction if can be committed using the tx_id
    if true {
        // if so commit the tx
    } else {
        // otherwise roll back it
    // finalize all the transaction marked to finalize and get a persy instance.
let persy = recover.finalize()?;


impl Recover[src]

pub fn list_transactions(&self) -> PRes<Vec<(TransactionId, RecoverStatus)>>[src]

List all the transactions found in the log with the current status

pub fn commit(&mut self, tx_id: TransactionId) -> PRes<()>[src]

Mark to commit a transaction in the log with state prepared commit

pub fn rollback(&mut self, tx_id: TransactionId) -> PRes<()>[src]

Mark to rollback a transaction that is not yet committed

pub fn status(&self, tx_id: TransactionId) -> PRes<Option<RecoverStatus>>[src]

Read the status of a transaction in the log

pub fn finalize(self) -> PRes<Persy>[src]

Recover all the prepared committed transactions that are not marked to rollback

Auto Trait Implementations

impl !RefUnwindSafe for Recover

impl Send for Recover

impl Sync for Recover

impl Unpin for Recover

impl !UnwindSafe for Recover

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,