Trait reth::providers::DBProvider
source · pub trait DBProvider:
Sized
+ Send
+ Sync
+ '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) -> Result<bool, ProviderError> { ... }
}
Expand description
Database provider.
Required Associated Types§
Required Methods§
sourcefn tx_mut(&mut self) -> &mut Self::Tx
fn tx_mut(&mut self) -> &mut Self::Tx
Returns a mutable reference to the underlying transaction.
sourcefn prune_modes_ref(&self) -> &PruneModes
fn prune_modes_ref(&self) -> &PruneModes
Returns a reference to prune modes.
Provided Methods§
sourcefn disable_long_read_transaction_safety(self) -> Self
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.
sourcefn commit(self) -> Result<bool, ProviderError>
fn commit(self) -> Result<bool, ProviderError>
Commit database transaction
Object Safety§
This trait is not object safe.