Trait reth_storage_api::DBProvider

source ·
pub trait DBProvider:
    Send
    + Sync
    + Sized
    + 'static {
    type Tx: DbTx;

    // Required methods
    fn tx_ref(&self) -> &Self::Tx;
    fn tx_mut(&mut self) -> &mut Self::Tx;
    fn into_tx(self) -> Self::Tx;
    fn prune_modes_ref(&self) -> &PruneModes;

    // Provided methods
    fn disable_long_read_transaction_safety(self) -> Self { ... }
    fn commit(self) -> ProviderResult<bool> { ... }
}
Expand description

Database provider.

Required Associated Types§

source

type Tx: DbTx

Underlying database transaction held by the provider.

Required Methods§

source

fn tx_ref(&self) -> &Self::Tx

Returns a reference to the underlying transaction.

source

fn tx_mut(&mut self) -> &mut Self::Tx

Returns a mutable reference to the underlying transaction.

source

fn into_tx(self) -> Self::Tx

Consumes the provider and returns the underlying transaction.

source

fn prune_modes_ref(&self) -> &PruneModes

Returns a reference to prune modes.

Provided Methods§

source

fn disable_long_read_transaction_safety(self) -> Self

Disables long-lived read transaction safety guarantees for leaks prevention and observability improvements.

CAUTION: In most of the cases, you want the safety guarantees for long read transactions enabled. Use this only if you’re sure that no write transaction is open in parallel, meaning that Reth as a node is offline and not progressing.

source

fn commit(self) -> ProviderResult<bool>

Commit database transaction

Object Safety§

This trait is not object safe.

Implementors§