pub struct BroadcastDynamic { /* private fields */ }Expand description
Handles on-demand track creation for a broadcast.
When a consumer requests a track that doesn’t exist, a TrackProducer is created and queued for the dynamic producer to fulfill via Self::requested_track. Dropped when no longer needed; pending requests are automatically aborted.
Implementations§
Source§impl BroadcastDynamic
impl BroadcastDynamic
Sourcepub async fn requested_track(&mut self) -> Result<Option<TrackProducer>, Error>
pub async fn requested_track(&mut self) -> Result<Option<TrackProducer>, Error>
Block until a consumer requests a track, returning its producer.
Sourcepub fn consume(&self) -> BroadcastConsumer
pub fn consume(&self) -> BroadcastConsumer
Create a consumer that can subscribe to tracks in this broadcast.
Trait Implementations§
Source§impl Clone for BroadcastDynamic
impl Clone for BroadcastDynamic
Source§fn clone(&self) -> BroadcastDynamic
fn clone(&self) -> BroadcastDynamic
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BroadcastDynamic
impl RefUnwindSafe for BroadcastDynamic
impl Send for BroadcastDynamic
impl Sync for BroadcastDynamic
impl Unpin for BroadcastDynamic
impl UnsafeUnpin for BroadcastDynamic
impl UnwindSafe for BroadcastDynamic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more