pub struct ContinuityCounter { /* private fields */ }
Expand description
A counter value used within a transport stream to detect discontinuities in a sequence of packets.
The continuity counter should increase by one for each packet with a given PID for which
adaptation_control
indicates that a payload should be present.
Implementations§
Source§impl ContinuityCounter
impl ContinuityCounter
Sourcepub fn new(count: u8) -> ContinuityCounter
pub fn new(count: u8) -> ContinuityCounter
Panics if the given value is greater than 15.
Sourcepub fn count(self) -> u8
pub fn count(self) -> u8
Returns this counter’s value, which will be between 0 and 15 inclusive.
Sourcepub fn follows(self, other: ContinuityCounter) -> bool
pub fn follows(self, other: ContinuityCounter) -> bool
true iff the given ContinuityCounter
value follows this one. Note that the maximum counter
value is 15, and the counter ‘wraps around’:
let a = ContinuityCounter::new(0);
let b = ContinuityCounter::new(15);
assert!(a.follows(b)); // after 15, counter wraps around to 0
Trait Implementations§
Source§impl Clone for ContinuityCounter
impl Clone for ContinuityCounter
Source§fn clone(&self) -> ContinuityCounter
fn clone(&self) -> ContinuityCounter
Returns a duplicate 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 moreSource§impl Debug for ContinuityCounter
impl Debug for ContinuityCounter
Source§impl From<u8> for ContinuityCounter
impl From<u8> for ContinuityCounter
Source§fn from(count: u8) -> ContinuityCounter
fn from(count: u8) -> ContinuityCounter
Converts to this type from the input type.
Source§impl PartialEq for ContinuityCounter
impl PartialEq for ContinuityCounter
impl Copy for ContinuityCounter
impl Eq for ContinuityCounter
impl StructuralPartialEq for ContinuityCounter
Auto Trait Implementations§
impl Freeze for ContinuityCounter
impl RefUnwindSafe for ContinuityCounter
impl Send for ContinuityCounter
impl Sync for ContinuityCounter
impl Unpin for ContinuityCounter
impl UnwindSafe for ContinuityCounter
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