[−][src]Struct ethox::wire::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.