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§
Sourcefn next(&self) -> ContentFuture<'_, Result<Option<ContentHandle>, ContentError>>
fn next(&self) -> ContentFuture<'_, Result<Option<ContentHandle>, ContentError>>
Resolves to the next item, or None once the stream is exhausted.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".