Skip to main content

Stream

Trait Stream 

Source
pub trait Stream: Send + 'static {
    type Ext: CatalogExt;

    // Required method
    fn poll_next(
        &mut self,
        waiter: &Waiter,
    ) -> Poll<Result<Option<Timed<Catalog<Self::Ext>>>>>;

    // Provided methods
    fn next(
        &mut self,
    ) -> impl Future<Output = Result<Option<Timed<Catalog<Self::Ext>>>>> + Send
       where Self: Sized { ... }
    fn select(self, selection: Broadcast) -> Select<Self>
       where Self: Sized { ... }
}
Expand description

A stream of catalog snapshots.

poll_next returns the next snapshot (a full catalog, not a delta) with the timestamp it takes effect at, or None once the underlying track has ended. Late snapshots supersede earlier ones, so an implementation may drop intermediate snapshots.

Stream types are required to be Send + 'static so they can be moved across threads and held inside exporters without per-call bounds.

Required Associated Types§

Source

type Ext: CatalogExt

The application extension carried by the yielded catalog (() for media-only).

Required Methods§

Source

fn poll_next( &mut self, waiter: &Waiter, ) -> Poll<Result<Option<Timed<Catalog<Self::Ext>>>>>

Poll for the next catalog snapshot and the timestamp it takes effect at on the broadcast’s media timeline, or None once the stream ends. A scale-less catalog track has no timeline: there the timestamp is the group key (see moq_json::Timed), so apply it on arrival.

Provided Methods§

Source

fn next( &mut self, ) -> impl Future<Output = Result<Option<Timed<Catalog<Self::Ext>>>>> + Send
where Self: Sized,

Wait for the next snapshot.

Source

fn select(self, selection: Broadcast) -> Select<Self>
where Self: Sized,

Wrap this stream in a Select that drops every rendition selection doesn’t keep.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<S: Stream + ?Sized> Stream for Box<S>

A boxed stream forwards to the stream it holds, so Box<dyn Stream<Ext = E>> is a stream.

Source§

type Ext = <S as Stream>::Ext

Source§

fn poll_next( &mut self, waiter: &Waiter, ) -> Poll<Result<Option<Timed<Catalog<Self::Ext>>>>>

Implementors§

Source§

impl<E: CatalogExt> Stream for Consumer<E>

Source§

type Ext = E

Source§

impl<S: Stream> Stream for Select<S>

Source§

type Ext = <S as Stream>::Ext