[][src]Crate persy

Persy - Transactional Persistence Engine

Simple single file, durable, paginated, transactional persistence engine, based on copy on write, write ahead log, two phase commit.

Example

use persy::{Persy,Config};
//...
Persy::create("./open.persy")?;
let persy = Persy::open("./open.persy",Config::new())?;
let mut tx = persy.begin()?;
persy.create_segment(&mut tx, "seg")?;
let data = vec![1;20];
persy.insert_record(&mut tx, "seg", &data)?;
let prepared = persy.prepare_commit(tx)?;
persy.commit(prepared)?;
for rec in persy.scan_records("seg")? {
    assert_eq!(rec.content[0], 20);
    //....
}

Structs

Config

Persy configuration structure.

IteratorItem

Snapshot of a record from the segment iterator

Persy

Main structure to operate persy storage files

RecordScanner

IntoIterator of persistent records of a segment

RecordScannerTx

IntoIterator of persistent records of a segment that include eventual in transaction changes

TransactionFinalize

prepared transaction state

Enums

PersyError

Enum of possible errors from Persy

TxStrategy

Concurrent Modification Strategy for resolution of conflict on commit.

Value

The associated value to the index key

ValueMode

Define the behavior of the index in case a key value pair already exists

Type Definitions

PRes
PersyId

Identifier of a persistent record, can be used for read, update or delete the record

Transaction

Transaction container, it include all the changes done in a transaction.

TransactionId