pub trait IRawDatabase:
Debug
+ MaybeSend
+ MaybeSync
+ 'static {
type Transaction<'a>: IRawDatabaseTransaction + Debug;
// Required methods
fn begin_transaction<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Self::Transaction<'a>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait;
fn checkpoint(&self, backup_path: &Path) -> Result<()>;
}
Expand description
Raw database implementation
This and IRawDatabaseTransaction
are meant to be implemented
by crates like fedimint-rocksdb
to provide a concrete implementation
of a database to be used by Fedimint.
This is in contrast of IDatabase
which includes extra
functionality that Fedimint needs (and adds) on top of it.
Required Associated Types§
Sourcetype Transaction<'a>: IRawDatabaseTransaction + Debug
type Transaction<'a>: IRawDatabaseTransaction + Debug
A raw database transaction type
Required Methods§
Sourcefn begin_transaction<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Self::Transaction<'a>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn begin_transaction<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Self::Transaction<'a>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Start a database transaction
fn checkpoint(&self, backup_path: &Path) -> Result<()>
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.