pub struct PacketQueue { /* private fields */ }Expand description
A reordering packet queue.
Packets are inserted in arbitrary order and extracted in PTS or DTS order.
Implementations§
Source§impl PacketQueue
impl PacketQueue
Sourcepub fn with_config(config: PacketQueueConfig) -> Self
pub fn with_config(config: PacketQueueConfig) -> Self
Create a new packet queue with custom configuration.
Sourcepub fn push(&mut self, packet: QueuedPacket) -> bool
pub fn push(&mut self, packet: QueuedPacket) -> bool
Push a packet into the queue. Returns true if accepted, false if dropped.
Sourcepub fn pop(&mut self) -> Option<QueuedPacket>
pub fn pop(&mut self) -> Option<QueuedPacket>
Pop the next packet in timestamp order.
Sourcepub fn total_bytes(&self) -> usize
pub fn total_bytes(&self) -> usize
Total bytes buffered.
Sourcepub fn stats(&self) -> &QueueStats
pub fn stats(&self) -> &QueueStats
Queue statistics.
Sourcepub fn drain(&mut self) -> Vec<QueuedPacket>
pub fn drain(&mut self) -> Vec<QueuedPacket>
Drain all packets in timestamp order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PacketQueue
impl RefUnwindSafe for PacketQueue
impl Send for PacketQueue
impl Sync for PacketQueue
impl Unpin for PacketQueue
impl UnsafeUnpin for PacketQueue
impl UnwindSafe for PacketQueue
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more