[−][src]Struct rtp_rs::Seq
16 bit RTP sequence number value, as obtained from the sequence_number()
method of RtpReader.
use rtp_rs::*; let seq = Seq::from(123);
This type's behavior attempts to honour the expected wrap-around of sequence number values
from 0xffff
back to 0x0000
.
You can perform logic over sequences of RTP packets using this type and other helpers from this crate,
let start = Seq::from(0xfffe); let end = Seq::from(0x0002); // produces the Seq values 0xfffe, 0xffff, 0x0000, 0x0001: for seq in (start..end).seq_iter() { // ...inspect some RTP packet you've stored against this sequence number... }
Methods
impl Seq
[src]
pub fn next(self) -> Seq
[src]
Produce the sequence value which follows this one.
Sequence numbers wrap back to 0x0000
after reaching the value 0xffff
pub fn precedes(self, other: Seq) -> bool
[src]
Returns true
if this sequence number value is immediately before the given one
Trait Implementations
impl Clone for Seq
[src]
impl PartialOrd<Seq> for Seq
[src]
fn partial_cmp(&self, other: &Seq) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Seq> for Seq
[src]
impl From<Seq> for u16
[src]
impl From<u16> for Seq
[src]
impl Copy for Seq
[src]
impl Add<u16> for Seq
[src]
type Output = Seq
The resulting type after applying the +
operator.
fn add(self, rhs: u16) -> Self::Output
[src]
impl Sub<Seq> for Seq
[src]
Implements wrapped subtraction such that for instance Seq(0x0000) - Seq(0xffff)
results in
1
(rather than -65535
).
This is for symmetry with addition, where for example Seq(0xffff) + 1
gives Seq(0x0000)
type Output = i32
The resulting type after applying the -
operator.
fn sub(self, rhs: Seq) -> Self::Output
[src]
impl Debug for Seq
[src]
Auto Trait Implementations
impl Send for Seq
impl Unpin for Seq
impl Sync for Seq
impl UnwindSafe for Seq
impl RefUnwindSafe for Seq
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,