pub struct BroadcastProducer { /* private fields */ }Expand description
Receive broadcast/track requests and return if we can fulfill them.
This is a pull-based producer. If you want an easier push-based producer, use [BroadcastProducer::map].
Implementations§
Source§impl BroadcastProducer
impl BroadcastProducer
pub fn new() -> Self
pub async fn requested(&self) -> TrackProducer
pub fn create(&self, track: Track) -> TrackProducer
Sourcepub fn insert(&self, track: TrackConsumer) -> Option<TrackConsumer>
pub fn insert(&self, track: TrackConsumer) -> Option<TrackConsumer>
Insert a new track into the lookup, returning the old track if it already exists.
Sourcepub fn remove(&self, name: &str) -> Option<TrackConsumer>
pub fn remove(&self, name: &str) -> Option<TrackConsumer>
Remove a track from the lookup.
pub fn consume(&self) -> BroadcastConsumer
Sourcepub async fn unused(&self)
pub async fn unused(&self)
Block until there are no more consumers.
A new consumer can be created by calling Self::consume and this will block again.
Trait Implementations§
Source§impl Clone for BroadcastProducer
impl Clone for BroadcastProducer
Source§fn clone(&self) -> BroadcastProducer
fn clone(&self) -> BroadcastProducer
Returns a copy 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 BroadcastProducer
impl RefUnwindSafe for BroadcastProducer
impl Send for BroadcastProducer
impl Sync for BroadcastProducer
impl !Unpin for BroadcastProducer
impl UnwindSafe for BroadcastProducer
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