[]Enum netsim_embed::PacketData

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

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>

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

Get a slice of the packet data.

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

No-op - returns self.

pub fn len(&self) -> usize

A length of the packet data.

Trait Implementations

impl<'p> Index<Range<usize>> for PacketData<'p>

type Output = [u8]

The returned type after indexing.

impl<'p> Index<RangeFrom<usize>> for PacketData<'p>

type Output = [u8]

The returned type after indexing.

impl<'p> Index<RangeFull> for PacketData<'p>

type Output = [u8]

The returned type after indexing.

impl<'p> Index<RangeTo<usize>> for PacketData<'p>

type Output = [u8]

The returned type after indexing.

impl<'p> Index<usize> for PacketData<'p>

type Output = u8

The returned type after indexing.

impl<'p> PartialEq<PacketData<'p>> for PacketData<'p>

impl<'p> StructuralPartialEq for PacketData<'p>

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

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

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

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