Struct optra::TransactionSequence [] [src]

pub struct TransactionSequence {
    pub inserts: LinkedList<InsertOperation>,
    pub deletes: LinkedList<DeleteOperation>,
    // some fields omitted
}

Represents a sequence of transactions that can be performed on a file.

The operations are stored in the order they occur in the file, and each operation assumes the previous operations have taken place. Furthermore, the insertion operations are assumed to take place prior to the deletion operations.

Fields

inserts: LinkedList<InsertOperation>

The inserts for this sequence, stored in effect order

deletes: LinkedList<DeleteOperation>

The deletes for this sequence, stored in effect order

Methods

impl TransactionSequence
[src]

fn new(last_timestamp: Option<(u32, u32)>, inserts: LinkedList<InsertOperation>, deletes: LinkedList<DeleteOperation>) -> TransactionSequence

Construct a new TransactionSequence from the given operations and metadata last_timestamp is the last stamp that was assigned before this operation was created timestamp_lookup is a mapping between local timestamps and their remote counterparts

fn apply(&self, file: &mut File) -> Result<()>

Apply the operations in this sequence to a file. This should not be called until after the sequence has been integrated via Engine::integrate_remote The file must have been opened on both read and write mode (see OpenOptions).

fn compress_to<W: Write>(&self, writer: &mut W) -> Result<()>

Compress this transaction and write to writer. The output can then be expanded back into an equivilent Transaction using expand_from()

fn expand_from<R: Read>(reader: &mut R, timestamp_lookup: Option<&BTreeMap<u32(u32, u32)>>) -> Result<TransactionSequence>

Expand this transaction from previously compressed data in reader. The data in reader should have been written using compress_to()

Trait Implementations

impl Clone for TransactionSequence
[src]

fn clone(&self) -> TransactionSequence

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Debug for TransactionSequence
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.