pub struct Recover { /* private fields */ }
Expand description

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

Example

let mut recover = Persy::recover("./target/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
        recover.commit(tx_id);
    } else {
        // otherwise roll back it
        recover.rollback(tx_id);
    }
    // finalize all the transaction marked to finalize and get a persy instance.
}
let persy = recover.finalize()?;

Implementations

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

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

Mark to rollback a transaction that is not yet committed

Read the status of a transaction in the log

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.