core::simd

Trait ToBytes

Source
pub trait ToBytes: Sealed {
    type Bytes: Copy + Unpin + Send + Sync + AsRef<[u8]> + AsMut<[u8]> + SimdUint<Scalar = u8> + 'static;

    // Required methods
    fn to_ne_bytes(self) -> Self::Bytes;
    fn to_be_bytes(self) -> Self::Bytes;
    fn to_le_bytes(self) -> Self::Bytes;
    fn from_ne_bytes(bytes: Self::Bytes) -> Self;
    fn from_be_bytes(bytes: Self::Bytes) -> Self;
    fn from_le_bytes(bytes: Self::Bytes) -> Self;
}
๐Ÿ”ฌThis is a nightly-only experimental API. (portable_simd #86656)
Expand description

Converts SIMD vectors to vectors of bytes

Required Associated Typesยง

Source

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

๐Ÿ”ฌThis is a nightly-only experimental API. (portable_simd #86656)

This type, reinterpreted as bytes.

Required Methodsยง

Source

fn to_ne_bytes(self) -> Self::Bytes

๐Ÿ”ฌThis is a nightly-only experimental API. (portable_simd #86656)

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

Source

fn to_be_bytes(self) -> Self::Bytes

๐Ÿ”ฌThis is a nightly-only experimental API. (portable_simd #86656)

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

Source

fn to_le_bytes(self) -> Self::Bytes

๐Ÿ”ฌThis is a nightly-only experimental API. (portable_simd #86656)

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

Source

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

๐Ÿ”ฌThis is a nightly-only experimental API. (portable_simd #86656)

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

Source

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

๐Ÿ”ฌThis is a nightly-only experimental API. (portable_simd #86656)

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

Source

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

๐Ÿ”ฌThis is a nightly-only experimental API. (portable_simd #86656)

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

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementorsยง

Sourceยง

impl ToBytes for Simd<f32, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<f32, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<f32, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<f32, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<f32, 16>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<f64, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<f64, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<f64, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<f64, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i8, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i8, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i8, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i8, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i8, 16>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i8, 32>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i8, 64>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i16, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i16, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i16, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i16, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i16, 16>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i16, 32>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i32, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i32, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i32, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i32, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i32, 16>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i64, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i64, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i64, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<i64, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<isize, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<isize, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<isize, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<isize, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u8, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u8, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u8, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u8, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u8, 16>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u8, 32>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u8, 64>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u16, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u16, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u16, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u16, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u16, 16>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u16, 32>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u32, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u32, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u32, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u32, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u32, 16>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u64, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u64, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u64, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<u64, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<usize, 1>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<usize, 2>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<usize, 4>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>

Sourceยง

impl ToBytes for Simd<usize, 8>

Sourceยง

type Bytes = Simd<u8, { $size * $elems }>