Skip to main content

ContentStream

Trait ContentStream 

Source
pub trait ContentStream {
    // Required method
    fn next(
        &self,
    ) -> ContentFuture<'_, Result<Option<ContentHandle>, ContentError>>;

    // Provided method
    fn produced(&self) -> Option<usize> { ... }
}
Expand description

An asynchronous stream of content.

next resolves once the next item is available; the producer wakes the pending future, so collectors never poll.

Required Methods§

Source

fn next(&self) -> ContentFuture<'_, Result<Option<ContentHandle>, ContentError>>

Resolves to the next item, or None once the stream is exhausted.

Provided Methods§

Source

fn produced(&self) -> Option<usize>

How many items the provider has produced so far, when it counts them.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§