[][src]Enum pnet_packet::PacketData

pub enum PacketData<'p> {
    Owned(Vec<u8>),
    Borrowed(&'p [u8]),
}

Packet data

Variants

Owned(Vec<u8>)

Packet owns its contents

Borrowed(&'p [u8])

Packet borrows its contents

Methods

impl<'p> PacketData<'p>[src]

pub fn as_slice(&self) -> &[u8][src]

Get a slice of the packet data

pub fn to_immutable(self) -> PacketData<'p>[src]

No-op - returns self

pub fn len(&self) -> usize[src]

Length of the packet data

Trait Implementations

impl<'p> Index<Range<usize>> for PacketData<'p>[src]

type Output = [u8]

The returned type after indexing.

impl<'p> Index<RangeFull> for PacketData<'p>[src]

type Output = [u8]

The returned type after indexing.

impl<'p> Index<RangeTo<usize>> for PacketData<'p>[src]

type Output = [u8]

The returned type after indexing.

impl<'p> Index<RangeFrom<usize>> for PacketData<'p>[src]

type Output = [u8]

The returned type after indexing.

impl<'p> Index<usize> for PacketData<'p>[src]

type Output = u8

The returned type after indexing.

impl<'p> PartialEq<PacketData<'p>> for PacketData<'p>[src]

Auto Trait Implementations

impl<'p> Send for PacketData<'p>

impl<'p> Sync for PacketData<'p>

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 = !

🔬 This is a nightly-only experimental API. (try_from)

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.