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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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