[][src]Crate structsy

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

Internal APIs used by the generated code to interact with structsy, not for public use

Structs

EmbeddedFilterDeprecated

Filter for an embedded structure

Filter

Generic filter for any Persistent structures

OwnedSytx

Owned transation to use with StructsyTx trait

PrepareOpenStructsy

Prepare open of a structsy file, with migrations possibilities

RangeIterator

Iterator implementation for Range of indexed persistent types

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

Structsy

Main API to persist structs with structsy.

StructsyConfig

Configuration builder for open/create a Structsy file.

StructsyIter

Iterator for query results

StructsyQuery

Query for a persistent struct

StructsyQueryTx

Query for a persistent struct considering in transaction changes.

UniqueRangeIterator

Iterator implementation for Range of unique indexed persistent types

Enums

Order

Query ordering

StructsyError
ValueMode

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

Traits

IntoResult

Execute a query on structsy or a structsy transaction

Operators

And/Or/Not Operators

PersistentEmbedded

Base trait implemented by all types that can be persisted inside a struct.

StructsyTx

Transaction behaviour trait.

Sytx

Type Definitions

SRes