Trait DbTxUnwindExt
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 as Table>::Key) -> u64 { ... }
fn unwind_table_by_walker<T1, T2>(
&self,
range: impl RangeBounds<<T1 as Table>::Key>,
) -> Result<(), DatabaseError>
where T1: Table,
T2: Table<Key = <T1 as Table>::Value> { ... }
}
Expand description
Extension trait for DbTxMut
that provides unwind functionality.
Provided Methods§
fn unwind_table_by_num<T>(&self, num: u64) -> Result<usize, DatabaseError>
fn unwind_table_by_num<T>(&self, num: u64) -> Result<usize, DatabaseError>
Unwind table by some number key. Returns number of rows unwound.
Note: Key is not inclusive and specified key would stay in db.
fn unwind_table<T, F>(
&self,
key: u64,
selector: F,
) -> Result<usize, DatabaseError>
fn unwind_table<T, F>( &self, key: u64, selector: F, ) -> Result<usize, DatabaseError>
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.
fn unwind_table_by_walker<T1, T2>(
&self,
range: impl RangeBounds<<T1 as Table>::Key>,
) -> Result<(), DatabaseError>
fn unwind_table_by_walker<T1, T2>( &self, range: impl RangeBounds<<T1 as Table>::Key>, ) -> Result<(), DatabaseError>
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.