Trait ToBytes

pub trait ToBytes

Converts SIMD vectors to vectors of bytes

Associated Types

type Bytes: Copy + Unpin + Send + Sync + AsRef<[u8]> + AsMut<[u8]> + SimdUint<Scalar = u8> + 'static;

This type, reinterpreted as bytes.

Required Methods

fn to_ne_bytes(self) -> Self::Bytes

Returns the memory representation of this integer as a byte array in native byte order.

fn to_be_bytes(self) -> Self::Bytes

Returns the memory representation of this integer as a byte array in big-endian (network) byte order.

fn to_le_bytes(self) -> Self::Bytes

Returns the memory representation of this integer as a byte array in little-endian byte order.

fn from_ne_bytes(bytes: Self::Bytes) -> Self

Creates a native endian integer value from its memory representation as a byte array in native endianness.

fn from_be_bytes(bytes: Self::Bytes) -> Self

Creates an integer value from its representation as a byte array in big endian.

fn from_le_bytes(bytes: Self::Bytes) -> Self

Creates an integer value from its representation as a byte array in little endian.

Implementors