add iter-from for bags-list (#11104)

* add iter-from for bags-list

* Fix

* Apply suggestions from code review

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Kian Paimani
2022-03-31 15:16:34 +01:00
committed by GitHub
parent 6ec4ee1647
commit c2d3d488b8
5 changed files with 79 additions and 2 deletions
@@ -441,6 +441,11 @@ pub trait SortedListProvider<AccountId> {
/// An iterator over the list, which can have `take` called on it.
fn iter() -> Box<dyn Iterator<Item = AccountId>>;
/// Returns an iterator over the list, starting right after from the given voter.
///
/// May return an error if `start` is invalid.
fn iter_from(start: &AccountId) -> Result<Box<dyn Iterator<Item = AccountId>>, Self::Error>;
/// The current count of ids in the list.
fn count() -> u32;