pub struct Consumer { /* private fields */ }Expand description
Subscribe to arbitrary broadcast/tracks.
Its close signal means this broadcast object ended, not that the path went offline: announcements say whether a path is live, and a new publisher may announce the same path again.
Implementations§
Source§impl Consumer
impl Consumer
Sourcepub fn tracks(&self) -> Result<Tracks, Error>
pub fn tracks(&self) -> Result<Tracks, Error>
List the broadcast’s tracks: each one with its info, then
TracksEvent::Synced, then changes as they happen.
Lists the tracks the producer created and any a session answers with, such as a
relay’s copy listing its upstream’s. A track served only on
request is never listed, and listing never requests one. Fails with
Error::Unroutable once the broadcast has ended.
Source§impl Consumer
impl Consumer
Sourcepub fn track(&self, name: &str) -> Result<Consumer, Error>
pub fn track(&self, name: &str) -> Result<Consumer, Error>
Get a lazy handle to a track on this broadcast.
Nothing is requested until the handle queries, subscribes, or fetches, each of
which looks the name up again. Fails with Error::Unroutable once the broadcast
has ended, and Error::NotFound when nothing publishes the track and no
Requests would serve a request for it.
Sourcepub fn meta(&self, name: &str) -> Result<Consumer, Error>
pub fn meta(&self, name: &str) -> Result<Consumer, Error>
Get a lazy handle to a track’s metadata: its groups and each frame’s header, without
the payload. See meta.
Fails as Self::track does.
Sourcepub fn datagrams(&self, name: &str) -> Result<Consumer, Error>
pub fn datagrams(&self, name: &str) -> Result<Consumer, Error>
Consume the datagram track name, live from now.
Joins the track a producer publishes, or asks a DatagramRequests handler for it,
whose answer the consumer reads. Fails with Error::Unroutable once the broadcast
has ended, and Error::NotFound when nothing publishes the track and no handler
would serve a request for it.
Sourcepub fn poll_closed(&self, waiter: &Waiter) -> Poll<()>
pub fn poll_closed(&self, waiter: &Waiter) -> Poll<()>
Resolves once the broadcast ends, by Producer::close or every producer dropping.
The poll composes close-detection into a larger one without spawning a task per broadcast.
Sourcepub async fn closed(&self)
pub async fn closed(&self)
Resolves once the broadcast ends, by Producer::close or every producer dropping.
The poll composes close-detection into a larger one without spawning a task per broadcast.
Awaits poll_closed.