[][src]Struct audiopus::packet::Packet

pub struct Packet<'a>(_);

A newtype around &[u8] to guarantee:

  • Minimum one element: A packet cannot be empty.
  • Limited size: A packet's length may not exceed std::i32::MAX.

Methods

impl<'a> Packet<'a>[src]

pub fn as_ptr(&self) -> *const u8[src]

pub fn i32_len(&self) -> i32[src]

The underlying type is immutably borrowed and has been verified upon construction of Packet, thus we know casting usize will fit inside i32.

Trait Implementations

impl<'a> TryInto<Packet<'a>> for &'a Vec<u8>[src]

type Error = Error

impl<'a> TryInto<Packet<'a>> for &'a [u8][src]

type Error = Error

impl<'a> TryInto<Packet<'a>> for &'a Packet<'a>[src]

type Error = Error

Auto Trait Implementations

impl<'a> Send for Packet<'a>

impl<'a> Sync for Packet<'a>

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.