pub struct Iterator<T: Storable> { /* private fields */ }Expand description
Iterator over collection items
Provides methods to iterate through all items in a collection.
Implementations§
Source§impl<T: Storable> Iterator<T>
impl<T: Storable> Iterator<T>
Sourcepub fn collect_all(&self) -> Result<Vec<T>>
pub fn collect_all(&self) -> Result<Vec<T>>
Collect all items into a vector
§Warning
This will load all items into memory. Use with caution on large collections.
Sourcepub fn for_each<F>(&self, f: F) -> Result<IterationStatus>
pub fn for_each<F>(&self, f: F) -> Result<IterationStatus>
Iterate and apply a function to each item
This is more memory-efficient than collect_all() for large datasets.
§Arguments
f- Function to apply to each item. Returnfalseto stop iteration early.
§Returns
Returns Ok(IterationStatus) where the status indicates whether iteration
completed or was stopped early by the callback.
Auto Trait Implementations§
impl<T> Freeze for Iterator<T>
impl<T> !RefUnwindSafe for Iterator<T>
impl<T> Send for Iterator<T>where
T: Send,
impl<T> Sync for Iterator<T>where
T: Sync,
impl<T> Unpin for Iterator<T>where
T: Unpin,
impl<T> !UnwindSafe for Iterator<T>
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