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§

Create a new instance of Self from an empty Store.

Load a saved instance of Self from persistent storage. Should only be invoked at startup time.

Access the filesystem directory in which stores this persistent state.

Provided Methods§

Load a saved instance of Self from persistent storage if present, or create a new one.

Implementors§