pub struct BroadcastProducer { /* private fields */ }Expand description
Receive broadcast/track requests and return if we can fulfill them.
Implementations§
Source§impl BroadcastProducer
impl BroadcastProducer
Sourcepub async fn requested_track(&mut self) -> Option<TrackProducer>
pub async fn requested_track(&mut self) -> Option<TrackProducer>
Return the next requested track.
Sourcepub fn create_track(&mut self, track: Track) -> TrackProducer
pub fn create_track(&mut self, track: Track) -> TrackProducer
Produce a new track and insert it into the broadcast.
Sourcepub fn insert_track(&mut self, track: TrackConsumer) -> bool
pub fn insert_track(&mut self, track: TrackConsumer) -> bool
Insert a track into the lookup, returning true if it was unique.
Sourcepub fn remove_track(&mut self, name: &str) -> bool
pub fn remove_track(&mut self, name: &str) -> bool
Remove a track from the lookup.
pub fn consume(&self) -> BroadcastConsumer
pub fn close(&mut self)
Sourcepub fn unused(&self) -> impl Future<Output = ()>
pub fn unused(&self) -> impl Future<Output = ()>
Block until there are no more consumers.
A new consumer can be created by calling Self::consume and this will block again.
pub fn is_clone(&self, other: &Self) -> bool
Trait Implementations§
Source§impl Clone for BroadcastProducer
impl Clone for BroadcastProducer
Source§impl Default for BroadcastProducer
impl Default for BroadcastProducer
Auto 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