Trait winter_utils::AsBytes

source ·
pub trait AsBytes {
    // Required method
    fn as_bytes(&self) -> &[u8] ;
}
Expand description

Defines a zero-copy representation of Self as a sequence of bytes.

Required Methods§

source

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

Returns a byte representation of self.

This method is intended to re-interpret the underlying memory as a sequence of bytes, and thus, should be zero-copy.

Implementations on Foreign Types§

source§

impl<const N: usize> AsBytes for [[u8; N]]

source§

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

Flattens a slice of byte arrays into a slice of bytes.

source§

impl<const N: usize, const M: usize> AsBytes for [[u8; N]; M]

source§

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

Flattens a two-dimensional array of bytes into a slice of bytes.

Implementors§