diff --git a/crates/trie/src/prefix_set/mod.rs b/crates/trie/src/prefix_set/mod.rs index b556dd379075..32fdc68c812d 100644 --- a/crates/trie/src/prefix_set/mod.rs +++ b/crates/trie/src/prefix_set/mod.rs @@ -161,6 +161,11 @@ impl PrefixSet { false } + /// Returns an iterator over reference to _all_ nibbles regardless of cursor position. + pub fn iter(&self) -> core::slice::Iter<'_, Nibbles> { + self.keys.iter() + } + /// Returns the number of elements in the set. pub fn len(&self) -> usize { self.keys.len()