pub trait AsyncIterator {
type Item;
// Required method
fn poll_next(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Self::Item>>;
// Provided method
fn size_hint(&self) -> (usize, Option<usize>) { ... }
}
🔬This is a nightly-only experimental API. (
async_iterator
)Expand description
A trait for dealing with asynchronous iterators.
This is the main async iterator trait. For more about the concept of async iterators
generally, please see the module-level documentation. In particular, you
may want to know how to implement AsyncIterator
.