async_iterator/lending_iter/
mod.rs

1/// An interface for dealing with iterators which borrow from `Self`
2
3#[must_use = "iterators are lazy and do nothing unless consumed"]
4pub trait LendingIterator {
5    /// The type of the elements being iterated over.
6    type Item<'a>
7    where
8        Self: 'a;
9
10    /// Advances the iterator and returns the next value.
11    async fn next(&mut self) -> Option<Self::Item<'_>>;
12}