mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 06:17:56 +00:00
add into function for PrefixIterator (#10614)
* add into function for PrefixIterator * update with comments * update with comments
This commit is contained in:
@@ -802,6 +802,19 @@ pub struct PrefixIterator<T, OnRemoval = ()> {
|
||||
phantom: core::marker::PhantomData<OnRemoval>,
|
||||
}
|
||||
|
||||
impl<T, OnRemoval1> PrefixIterator<T, OnRemoval1> {
|
||||
/// Converts to the same iterator but with the different 'OnRemoval' type
|
||||
pub fn convert_on_removal<OnRemoval2>(self) -> PrefixIterator<T, OnRemoval2> {
|
||||
PrefixIterator::<T, OnRemoval2> {
|
||||
prefix: self.prefix,
|
||||
previous_key: self.previous_key,
|
||||
drain: self.drain,
|
||||
closure: self.closure,
|
||||
phantom: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for specialising on removal logic of [`PrefixIterator`].
|
||||
pub trait PrefixIteratorOnRemoval {
|
||||
/// This function is called whenever a key/value is removed.
|
||||
|
||||
Reference in New Issue
Block a user