[][src]Struct ethox::wire::payload

#[repr(transparent)]
pub struct payload(_);

A dynamically sized type representing a packet payload.

This type is seemingly just a [u8]. It is a newtype wrapper so that this crate can freely implement traits for it but also restrict the standard trait implementations to not be available.

To create a payload use the provided From trait impls, to convert it back you can use either of the synonyms as_bytes or as_slice, and their mutable variants.

Methods

impl payload[src]

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

Converts this payload to a standard byte slice. This is a no-op pointer conversion.

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

Converts this payload to a mutable byte slice. This is a no-op pointer conversion.

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

Converts this payload to a standard byte slice. This is a no-op pointer conversion.

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

Converts this payload to a mutable byte slice. This is a no-op pointer conversion.

Trait Implementations

impl AsMut<[u8]> for payload[src]

impl AsRef<[u8]> for payload[src]

impl Debug for payload[src]

impl Deref for payload[src]

type Target = [u8]

The resulting type after dereferencing.

impl DerefMut for payload[src]

impl Eq for payload[src]

impl<'a> From<&'a [u8]> for &'a payload[src]

impl<'a> From<&'a mut [u8]> for &'a mut payload[src]

impl<'a> From<&'a mut payload> for &'a mut [u8][src]

impl<'a> From<&'a payload> for &'a [u8][src]

impl Ord for payload[src]

impl PartialEq<payload> for payload[src]

impl PartialOrd<payload> for payload[src]

impl Payload for payload[src]

impl PayloadMut for payload[src]

impl StructuralEq for payload[src]

impl StructuralPartialEq for payload[src]

Auto Trait Implementations

impl Send for payload

impl Sync for payload

impl Unpin for payload

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]