reth_db_api

Trait DbTxUnwindExt

source
pub trait DbTxUnwindExt: DbTxMut {
    // Provided methods
    fn unwind_table_by_num<T>(&self, num: u64) -> Result<usize, DatabaseError>
       where T: Table<Key = u64> { ... }
    fn unwind_table<T, F>(
        &self,
        key: u64,
        selector: F,
    ) -> Result<usize, DatabaseError>
       where T: Table,
             F: FnMut(T::Key) -> u64 { ... }
    fn unwind_table_by_walker<T1, T2>(
        &self,
        range: impl RangeBounds<T1::Key>,
    ) -> Result<(), DatabaseError>
       where T1: Table,
             T2: Table<Key = T1::Value> { ... }
}
Expand description

Extension trait for DbTxMut that provides unwind functionality.

Provided Methods§

source

fn unwind_table_by_num<T>(&self, num: u64) -> Result<usize, DatabaseError>
where T: Table<Key = u64>,

Unwind table by some number key. Returns number of rows unwound.

Note: Key is not inclusive and specified key would stay in db.

source

fn unwind_table<T, F>( &self, key: u64, selector: F, ) -> Result<usize, DatabaseError>
where T: Table, F: FnMut(T::Key) -> u64,

Unwind the table to a provided number key. Returns number of rows unwound.

Note: Key is not inclusive and specified key would stay in db.

source

fn unwind_table_by_walker<T1, T2>( &self, range: impl RangeBounds<T1::Key>, ) -> Result<(), DatabaseError>
where T1: Table, T2: Table<Key = T1::Value>,

Unwind a table forward by a Walker on another table.

Note: Range is inclusive and first key in the range is removed.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> DbTxUnwindExt for T
where T: DbTxMut,