pub trait AsyncIterator {
type Item;
// Required method
fn next_async(&mut self) -> impl Future<Output = Option<Self::Item>>;
// Provided methods
fn sync_iter(
&mut self,
) -> impl Future<Output = SyncIter<IntoIter<Self::Item>>>
where Self: Sized { ... }
fn async_size_hint(&self) -> (usize, Option<usize>) { ... }
fn async_collect<B>(self) -> impl Future<Output = B>
where Self: Sized,
B: FromIterator<Self::Item> { ... }
}Required Associated Types§
Required Methods§
fn next_async(&mut self) -> impl Future<Output = Option<Self::Item>>
Provided Methods§
fn sync_iter(&mut self) -> impl Future<Output = SyncIter<IntoIter<Self::Item>>>where
Self: Sized,
fn async_size_hint(&self) -> (usize, Option<usize>)
fn async_collect<B>(self) -> impl Future<Output = B>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.