Skip to main content

AsyncIterator

Trait AsyncIterator 

Source
pub trait AsyncIterator<E: Send + Sync + 'static>: Send + Sync {
    type Item: Send + Sync;

    // Required method
    fn next<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Item>, E>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn next<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Item>, E>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The traditional next method for iterators, with a Result and Error type. Returns None when everything is done.

Implementations on Foreign Types§

Source§

impl<E: Send + Sync + 'static> AsyncIterator<E> for Vec<u8>

Source§

type Item = Vec<u8>

Source§

fn next<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Item>, E>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§