Trait serai_coordinator::db::Db

source ·
pub trait Db: 'static + Send + Sync + Clone + Get {
    type Transaction<'a>: DbTxn;

    // Required method
    fn txn(&mut self) -> Self::Transaction<'_>;

    // Provided method
    fn key(
        db_dst: &'static [u8],
        item_dst: &'static [u8],
        key: impl AsRef<[u8]>,
    ) -> Vec<u8>  { ... }
}
Expand description

A database supporting atomic operations.

Required Associated Types§

Required Methods§

source

fn txn(&mut self) -> Self::Transaction<'_>

Provided Methods§

source

fn key( db_dst: &'static [u8], item_dst: &'static [u8], key: impl AsRef<[u8]>, ) -> Vec<u8>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Db for Arc<Db>

§

type Transaction<'a> = Transaction<'a>

source§

fn txn(&mut self) -> <Arc<Db> as Db>::Transaction<'_>

source§

impl<T> Db for Arc<DBCommon<T, OptimisticTransactionDBInner>>
where T: Send + ThreadMode + 'static,

§

type Transaction<'a> = Transaction<'a, T>

source§

fn txn( &mut self, ) -> <Arc<DBCommon<T, OptimisticTransactionDBInner>> as Db>::Transaction<'_>

Implementors§

source§

impl Db for MemDb

§

type Transaction<'a> = MemDbTxn<'a>