pub struct Track {
pub name: String,
pub priority: u8,
}Expand description
A track is a collection of groups, delivered out-of-order until expired.
Fields§
§name: StringIdentifier within a broadcast. Unique per crate::Broadcast.
priority: u8Delivery priority. Higher values preempt lower ones when bandwidth is constrained.
Implementations§
Source§impl Track
impl Track
Sourcepub fn new<T: Into<String>>(name: T) -> Self
pub fn new<T: Into<String>>(name: T) -> Self
Create a track with the given name and default priority (0).
Sourcepub fn with_priority(self, priority: u8) -> Self
pub fn with_priority(self, priority: u8) -> Self
Set the delivery priority, returning self for chaining.
Sourcepub fn produce(self) -> TrackProducer
pub fn produce(self) -> TrackProducer
Consume this Track to create a producer that owns its metadata.
Trait Implementations§
impl Eq for Track
Source§impl From<Track> for TrackProducer
impl From<Track> for TrackProducer
impl StructuralPartialEq for Track
Auto Trait Implementations§
impl Freeze for Track
impl RefUnwindSafe for Track
impl Send for Track
impl Sync for Track
impl Unpin for Track
impl UnsafeUnpin for Track
impl UnwindSafe for Track
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