pub trait Persist<FE: ThreadSafe + Clone>: Sized {
type Txn: Transaction<FE>;
type Schema: Clone + Send + Sync;
// Required methods
fn create<'async_trait>(
txn_id: TxnId,
schema: Self::Schema,
store: Dir<FE>,
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>>
where Self: 'async_trait;
fn load<'async_trait>(
txn_id: TxnId,
schema: Self::Schema,
store: Dir<FE>,
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>>
where Self: 'async_trait;
fn dir(&self) -> Inner<FE>;
// Provided method
fn load_or_create<'async_trait>(
txn_id: TxnId,
schema: Self::Schema,
store: Dir<FE>,
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>>
where Self: Send + 'async_trait { ... }
}
Expand description
Defines how to load a persistent data structure from the filesystem.
Required Associated Types§
Required Methods§
Sourcefn create<'async_trait>(
txn_id: TxnId,
schema: Self::Schema,
store: Dir<FE>,
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
fn create<'async_trait>(
txn_id: TxnId,
schema: Self::Schema,
store: Dir<FE>,
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
Create a new instance of Self
from an empty Store
.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.