Struct mpeg2ts_reader::packet::ContinuityCounter
source · 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
sourceimpl 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 0Trait Implementations
sourceimpl Clone for ContinuityCounter
impl Clone for ContinuityCounter
sourcefn clone(&self) -> ContinuityCounter
fn clone(&self) -> ContinuityCounter
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for ContinuityCounter
impl Debug for ContinuityCounter
sourceimpl From<u8> for ContinuityCounter
impl From<u8> for ContinuityCounter
sourcefn from(count: u8) -> ContinuityCounter
fn from(count: u8) -> ContinuityCounter
Converts to this type from the input type.
sourceimpl PartialEq<ContinuityCounter> for ContinuityCounter
impl PartialEq<ContinuityCounter> for ContinuityCounter
sourcefn eq(&self, other: &ContinuityCounter) -> bool
fn eq(&self, other: &ContinuityCounter) -> bool
impl Copy for ContinuityCounter
impl StructuralPartialEq for ContinuityCounter
Auto Trait Implementations
impl RefUnwindSafe for ContinuityCounter
impl Send for ContinuityCounter
impl Sync for ContinuityCounter
impl Unpin for ContinuityCounter
impl UnwindSafe for ContinuityCounter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more