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;
pub use internal::PersistentEmbedded;
Modules§
- derive
- Re Export proc macros
- internal
- Internal APIs used by the generated code to interact with structsy, not for public use
- record
- Raw access structures
Structs§
- Filter
- Generic filter for any Persistent structures
- Owned
Sytx - Owned transation to use with
StructsyTx
trait - Prepare
Open - Prepare open of a structsy file, with migrations possibilities
- Prepared
- Transaction prepared state ready to be committed if the second phase is considered successful
- RawIter
- Iterator of raw Records
- RawPrepare
- Prepared state of RawTransaction
- RawTransaction
- Transaction for save data in a structsy database without the original source code
- Ref
- Reference to a record, can be used to load a record or to refer a record from another one.
- RefSytx
- Reference transaction to use with
StructsyTx
trait - Snapshot
- Read data from a snapshot freezed in a specific moment ignoring all the subsequent committed transactions.
- Snapshot
Query - A query to be executed on a specific snapshot
- Structsy
- Main API to persist structs with structsy.
- Structsy
Config - Configuration builder for open/create a Structsy file.
- Structsy
Iter - Iterator for query results
- Structsy
Query - Query for a persistent struct
- Structsy
Query Tx - Query for a persistent struct considering in transaction changes.
Enums§
- Order
- Query ordering
- Structsy
Error - All the possible Structsy errors
- Value
Mode - Define the behavior of the index in case a key value pair already exists
Traits§
- Fetch
- Execute a query on structsy or a structsy transaction
- Into
Result Deprecated - Operators
- And/Or/Not Operators
- RawAccess
- Trait for data operations that do not require original structs and enums source code.
- RawRead
- Structsy
Tx - Transaction behaviour trait.
- Sytx