Crate persy[−][src]
Expand description
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()?; tx.create_segment("seg")?; let data = vec![1;20]; tx.insert("seg", &data)?; let prepared = tx.prepare()?; prepared.commit()?; for (_id,content) in persy.scan("seg")? { assert_eq!(content[0], 20); //.... }
Structs
ByteVec | Wrapper for |
Config | Persy configuration structure. |
IndexId | Unique identifier of an index |
IndexInfo | Index definition details |
IndexIter | Index Iterator implementation for iterating on a range of keys |
OpenOptions | Options, flags, configs which can be used to configure how a persy database is opened. |
Persy | Main structure to operate persy storage files |
PersyId | Identifier of a persistent record, can be used for read, update or delete the record |
Recover | Intermediate recover status to select witch transactions to commit or rollback and list witch transactions are in a intermediate state |
SegmentId | Represents a looked-up segment |
SegmentIter | Iterator implementation to scan a segment |
Snapshot | Read snapshot at a specific point in time. |
SnapshotSegmentIter | Iterator implementation to scan a segment considering in transaction changes. |
Transaction | Transaction container, it include all the changes done in a transaction. |
TransactionConfig | Configure the parameters for the transaction on the begin of a new transaction. |
TransactionFinalize | prepared transaction state |
TxIndexIter | Index Iterator implementation for iterating on a range of keys |
TxSegmentIter | Iterator implementation to scan a segment considering in transaction changes. |
Enums
IndexTypeId | Enum of all the possible Key or Value types for indexes |
PersyError | Enum of possible errors from Persy |
RecoverStatus | Possible state of a transaction in the log |
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 |
Traits
IndexType | Trait implemented by all supported types in the index |
ToIndexId | |
ToSegmentId |
Type Definitions
PRes | |
TransactionId | Custom identifier to track the transaction in the recover phase |