pub struct SingleMapKeyProvider { /* private fields */ }Expand description
Built-in provider for iterating keys from a single NitriteMap.
§Purpose
SingleMapKeyProvider is the default implementation of KeyIteratorProvider for
iterating over all keys in a single NitriteMap. It uses the map’s navigation methods
to traverse keys in sorted order without retrieving values.
§Characteristics
- Sorted Traversal: Iterates keys in sorted order
- Stateful: Tracks the current position using the last visited key
- Lazy Navigation: Uses key-based navigation rather than preloading all keys
- Bidirectional: Supports both forward and backward iteration
- Efficient: Only accesses keys, avoiding value retrieval overhead
Implementations§
Source§impl SingleMapKeyProvider
impl SingleMapKeyProvider
Sourcepub fn new(map: NitriteMap) -> Self
pub fn new(map: NitriteMap) -> Self
Creates a new key provider for a NitriteMap.
§Arguments
map- TheNitriteMapto iterate over
§Returns
A new SingleMapKeyProvider initialized at position before the first key.
§Behavior
- Starts with
current=None, indicating position before the first key - First call to
next_key()will return the key atmap.first_key() - First call to
prev_key()will return the key atmap.last_key() - The map is cloned internally; changes to the original map are reflected
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SingleMapKeyProvider
impl !UnwindSafe for SingleMapKeyProvider
impl Freeze for SingleMapKeyProvider
impl Send for SingleMapKeyProvider
impl Sync for SingleMapKeyProvider
impl Unpin for SingleMapKeyProvider
impl UnsafeUnpin for SingleMapKeyProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more