pub trait PersistentStorageProvider: Send + Sync {
// Required method
fn open_session(&self) -> StorageBackendResult<PersistentStorageSession>;
// Provided methods
fn open_initial_session(
&self,
) -> StorageBackendResult<PersistentStorageSession> { ... }
fn storage_identity(
&self,
) -> StorageBackendResult<Option<PersistentStorageIdentity>> { ... }
fn auxiliary_encryption_key(&self) -> Option<StorageEncryptionKey> { ... }
}Expand description
Factory for independent sessions over one durable database.
A provider owns the database-level resource while each returned session
owns its transaction state. This is the engine-facing extension point for
SQLite, redb, and application-defined Key/Value stores.
Required Methods§
fn open_session(&self) -> StorageBackendResult<PersistentStorageSession>
Provided Methods§
Sourcefn open_initial_session(&self) -> StorageBackendResult<PersistentStorageSession>
fn open_initial_session(&self) -> StorageBackendResult<PersistentStorageSession>
Open handles for initial Engine restoration. Providers may defer catalog schema preparation until CatalogFacade::initialize_storage runs inside the owning transaction; ordinary session factories must return an initialized catalog.
Sourcefn storage_identity(
&self,
) -> StorageBackendResult<Option<PersistentStorageIdentity>>
fn storage_identity( &self, ) -> StorageBackendResult<Option<PersistentStorageIdentity>>
Return the database identity shared by every session this provider opens. Custom providers that cannot expose a stable identity may keep the default; engines built from the same Arc provider still share an in-process coordinator.
Sourcefn auxiliary_encryption_key(&self) -> Option<StorageEncryptionKey>
fn auxiliary_encryption_key(&self) -> Option<StorageEncryptionKey>
Protect engine-owned auxiliary files with the database’s encryption
credential. Encrypted file providers must forward this capability;
None declares that their auxiliary storage may be unencrypted.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".