Trait tc_transact::fs::Persist
source · pub trait Persist<D: Dir>: Sized {
type Txn: Transaction<D>;
type Schema: Clone + Send + Sync;
fn create(
txn_id: TxnId,
schema: Self::Schema,
store: D::Store
) -> TCResult<Self>;
fn load(
txn_id: TxnId,
schema: Self::Schema,
store: D::Store
) -> TCResult<Self>;
fn dir(&self) -> D::Inner;
fn load_or_create(
txn_id: TxnId,
schema: Self::Schema,
store: D::Store
) -> TCResult<Self> { ... }
}
Expand description
Defines how to load a persistent data structure from the filesystem.
Required Associated Types§
Required Methods§
sourcefn create(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
fn create(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
Create a new instance of Self
from an empty Store
.