fedimint_core::db

Trait IRawDatabase

source
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§

source

type Transaction<'a>: IRawDatabaseTransaction + Debug

A raw database transaction type

Required Methods§

source

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

source

fn checkpoint(&self, backup_path: &Path) -> Result<()>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> IRawDatabase for Box<T>
where T: IRawDatabase,

source§

type Transaction<'a> = <T as IRawDatabase>::Transaction<'a>

source§

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,

source§

fn checkpoint(&self, backup_path: &Path) -> Result<()>

Implementors§