pub struct Consumer { /* private fields */ }Expand description
A cursor over the renditions this transcoder produces.
Shaped like moq_net::announce::Consumer: it yields one rendition at a
time rather than a snapshot of the whole ladder, and it starts before the
ladder, so it reports every rendition once (with Update::encoding false)
and then every start and stop. Obtained from
Transcoder::active.
It is a cursor, not a log: a rendition that starts and stops between two
calls is reported neither time. Bill from Rendition::frames, which counts
it regardless.
while let Some(update) = active.next().await {
match update.encoding {
true => println!("{} started", update.rendition.name()),
false => println!("{} idle after {} frames", update.rendition.name(), update.rendition.frames()),
}
}Implementations§
Source§impl Consumer
impl Consumer
Sourcepub async fn next(&mut self) -> Option<Update>
pub async fn next(&mut self) -> Option<Update>
The next rendition to report, or None once the transcoder is gone.
Sourcepub fn poll_next(&mut self, waiter: &Waiter) -> Poll<Option<Update>>
pub fn poll_next(&mut self, waiter: &Waiter) -> Poll<Option<Update>>
Poll for the next rendition to report, without blocking.
Returns Poll::Ready(Some(_)) for an update, Poll::Ready(None) once the
transcoder is gone, or Poll::Pending after registering waiter.