Crate structsy[−][src]
Expand description
Simple single file struct persistence manger
Example
use structsy::{Structsy, StructsyError, StructsyTx};
use structsy_derive::Persistent;
#[derive(Persistent)]
struct MyData {
name: String,
address: String,
}
// ......
let db = Structsy::open("my_data.db")?;
db.define::<MyData>()?;
let my_data = MyData {
name: "Structsy".to_string(),
address: "https://gitlab.com/tglman/structsy".to_string(),
};
let mut tx = db.begin()?;
tx.insert(&my_data)?;
tx.commit()?;
Re-exports
pub use internal::Persistent;
Modules
Internal APIs used by the generated code to interact with structsy, not for public use
Raw access structures
Structs
Generic filter for any Persistent structures
Owned transation to use with StructsyTx
trait
Prepare open of a structsy file, with migrations possibilities
Transaction prepared state ready to be committed if the second phase is considered successful
Iterator implementation for Range of indexed persistent types
Iterator of raw Records
Prepared state of RawTransaction
Transaction for save data in a structsy database without the original source code
Reference to a record, can be used to load a record or to refer a record from another one.
Reference transaction to use with StructsyTx
trait
Read data from a snapshot freezed in a specific moment ignoring all the subsequent committed transactions.
A query to be executed on a specific snapshot
Main API to persist structs with structsy.
Configuration builder for open/create a Structsy file.
Iterator for query results
Query for a persistent struct
Query for a persistent struct considering in transaction changes.
Iterator implementation for Range of unique indexed persistent types
Enums
Query ordering
All the possible Structsy errors
Define the behavior of the index in case a key value pair already exists
Traits
Execute a query on structsy or a structsy transaction
And/Or/Not Operators
Base trait implemented by all types that can be persisted inside a struct.
Trait for data operations that do not require original structs and enums source code.
Transaction behaviour trait.