pub struct TagIteratorAsync<R: AsyncRead + Unpin, TSpec>where
    TSpec: EbmlSpecification<TSpec> + EbmlTag<TSpec> + Clone,
{ /* private fields */ }
Expand description

This Can be transformed into a [Stream] using into_stream, or consumed directly by calling [.next().await] in a loop.

The struct can be created with the new() function on any source that implements the [futures::AsyncRead] trait.

Implementations§

can be consumed

Examples found in repository?
src/tag_iterator_async.rs (line 191)
189
190
191
192
193
194
    pub fn into_stream(self) -> impl Stream<Item=Result<TSpec, TagIteratorError>> {
        futures::stream::unfold(self, |mut read| async {
            let next = read.next().await;
            next.map(move |it| (it, read))
        })
    }

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.