Trait async_iterator::Iterator
source · [−]pub trait Iterator {
type Item;
fn next(&mut self) -> impl Future<Output = Option<Self::Item>>;
fn size_hint(&self) -> (usize, Option<usize>) { ... }
fn map<B, F>(self, f: F) -> Map<Self, F>
where
Self: Sized,
F: FnMut(Self::Item) -> B,
{ ... }
async fn collect<B: FromIterator<Self::Item>>(self) -> B
where
Self: Sized,
{ ... }
}
Expand description
An interface for dealing with iterators.
Required Associated Types
Required Methods
Provided Methods
sourcefn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator.
sourcefn map<B, F>(self, f: F) -> Map<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> B,
fn map<B, F>(self, f: F) -> Map<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> B,
Takes a closure and creates an iterator which calls that closure on each element.
sourceasync fn collect<B: FromIterator<Self::Item>>(self) -> Bwhere
Self: Sized,
async fn collect<B: FromIterator<Self::Item>>(self) -> Bwhere
Self: Sized,
Transforms an iterator into a collection.