pub struct Requests { /* private fields */ }Expand description
Handles on-demand track creation for a broadcast.
When a consumer requests a track that doesn’t exist, the dynamic producer
picks up the request via Self::poll_requested_track and either
track::Request::accepts it with a concrete track::Info or
track::Request::rejects it. Dropped when no longer needed; pending requests
are automatically aborted.
Implementations§
Source§impl Requests
impl Requests
Sourcepub fn poll_requested_track(
&mut self,
waiter: &Waiter,
) -> Poll<Result<Request, Error>>
pub fn poll_requested_track( &mut self, waiter: &Waiter, ) -> Poll<Result<Request, Error>>
The next track a consumer requests, as a track::Request to serve.
Returns Error::Closed once the broadcast has ended, so a serving loop
knows to stop and release its handle.
Sourcepub async fn requested_track(&mut self) -> Result<Request, Error>
pub async fn requested_track(&mut self) -> Result<Request, Error>
The next track a consumer requests, as a track::Request to serve.
Returns Error::Closed once the broadcast has ended, so a serving loop
knows to stop and release its handle.
Awaits poll_requested_track.
Sourcepub fn consume(&self) -> Consumer
pub fn consume(&self) -> Consumer
Create a consumer that can subscribe to tracks in this broadcast.
Sourcepub fn datagrams(&self) -> DatagramRequests
pub fn datagrams(&self) -> DatagramRequests
A handler for the datagram tracks consumers ask for. Until one exists, asking for a
datagram track nothing publishes fails with Error::NotFound.
Sourcepub fn lister(&self) -> Result<Lister, Error>
pub fn lister(&self) -> Result<Lister, Error>
Answer the broadcast’s track listings, for a handler that knows the tracks it
would serve, such as a relay listing its upstream’s. See Lister.
A handler that serves any name on request takes none, so it lists nothing. One
answer per broadcast: fails with Error::Duplicate while another lister exists.
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.
Sourcepub async fn closed(&self)
pub async fn closed(&self)
Resolves once the broadcast ends, by Producer::close or every producer dropping.
Awaits poll_closed.