Enum libpacket::PacketData[][src]

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

Packet data.

Variants

Owned(Vec<u8, Global>)

A packet owns its contents.

Borrowed(&'p [u8])

A packet borrows its contents.

Implementations

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]

A length of the packet data.

Trait Implementations

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

type Output = [u8]

The returned type after indexing.

pub fn index(&self, index: Range<usize>) -> &[u8][src]

Performs the indexing (container[index]) operation. Read more

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

type Output = [u8]

The returned type after indexing.

pub fn index(&self, index: RangeFrom<usize>) -> &[u8][src]

Performs the indexing (container[index]) operation. Read more

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

type Output = [u8]

The returned type after indexing.

pub fn index(&self, index: RangeFull) -> &[u8][src]

Performs the indexing (container[index]) operation. Read more

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

type Output = [u8]

The returned type after indexing.

pub fn index(&self, index: RangeTo<usize>) -> &[u8][src]

Performs the indexing (container[index]) operation. Read more

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

type Output = u8

The returned type after indexing.

pub fn index(&self, index: usize) -> &u8[src]

Performs the indexing (container[index]) operation. Read more

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

pub fn eq(&self, other: &PacketData<'p>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &PacketData<'p>) -> bool[src]

This method tests for !=.

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

Auto Trait Implementations

impl<'p> RefUnwindSafe for PacketData<'p>

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

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

impl<'p> Unpin for PacketData<'p>

impl<'p> UnwindSafe for PacketData<'p>

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.