[][src]Enum pnet_packet::MutPacketData

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

Mutable packet data

Variants

Owned(Vec<u8>)

Owned mutable packet data

Borrowed(&'p mut [u8])

Borrowed mutable packet data

Methods

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

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

Get packet data as a slice

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

Get packet data as a mutable slice

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

Get an immutable version of the packet data

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

Get the length of data in the packet

Trait Implementations

impl<'p> IndexMut<RangeFull> for MutPacketData<'p>[src]

impl<'p> IndexMut<RangeTo<usize>> for MutPacketData<'p>[src]

impl<'p> IndexMut<Range<usize>> for MutPacketData<'p>[src]

impl<'p> IndexMut<usize> for MutPacketData<'p>[src]

impl<'p> IndexMut<RangeFrom<usize>> for MutPacketData<'p>[src]

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

type Output = [u8]

The returned type after indexing.

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

type Output = [u8]

The returned type after indexing.

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

type Output = [u8]

The returned type after indexing.

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

type Output = u8

The returned type after indexing.

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

type Output = [u8]

The returned type after indexing.

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

Auto Trait Implementations

impl<'p> Send for MutPacketData<'p>

impl<'p> Sync for MutPacketData<'p>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<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.