[][src]Struct rtp_rs::Seq

pub struct 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]

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.

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.

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]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]