Trait serai_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<ParityDb>

§

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

source§

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

source§

impl<T: Send + ThreadMode + 'static> Db for Arc<OptimisticTransactionDB<T>>

§

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

source§

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

Implementors§

source§

impl Db for MemDb

§

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