kvarn_async::prelude::compact_str::core::async_iter

Trait AsyncIterator

source
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.

Required Associated Types§

source

type Item

🔬This is a nightly-only experimental API. (async_iterator)

The type of items yielded by the async iterator.

Required Methods§

source

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

🔬This is a nightly-only experimental API. (async_iterator)

Attempts to pull out the next value of this async iterator, registering the current task for wakeup if the value