pub struct Producer { /* private fields */ }Expand description
Publishes a binary value over a track, one value per group.
Each update rolls a new group holding the whole value, so a consumer only ever
needs the newest group and older ones are dropped. For a log where every payload survives, use
stream instead.
Cheaply clonable: clones share one underlying track, like other MoQ producers.
Implementations§
Source§impl Producer
impl Producer
Sourcepub fn new(track: Producer, config: Config) -> Self
pub fn new(track: Producer, config: Config) -> Self
Create a producer that publishes to the given track.
Sourcepub fn consume(&self) -> Subscriber
pub fn consume(&self) -> Subscriber
Create a subscriber for the underlying track.
Sourcepub fn is_used(&self) -> bool
pub fn is_used(&self) -> bool
Whether any consumer for the underlying track currently exists.
The demand signal for a producer serving on request: an unused track is cached state nobody is watching, safe to drop and recreate on the next request.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Producer
impl RefUnwindSafe for Producer
impl Send for Producer
impl Sync for Producer
impl Unpin for Producer
impl UnsafeUnpin for Producer
impl UnwindSafe for Producer
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