Skip to main content

IntoBytes

Trait IntoBytes 

Source
pub unsafe trait IntoBytes {
    // Provided methods
    fn as_bytes(&self) -> &[u8] ⓘ
       where Self: Immutable { ... }
    fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
       where Self: FromBytes { ... }
    fn write_to(
        &self,
        dst: &mut [u8],
    ) -> Result<(), SizeError<&Self, &mut [u8]>>
       where Self: Immutable { ... }
    fn write_to_prefix(
        &self,
        dst: &mut [u8],
    ) -> Result<(), SizeError<&Self, &mut [u8]>>
       where Self: Immutable { ... }
    fn write_to_suffix(
        &self,
        dst: &mut [u8],
    ) -> Result<(), SizeError<&Self, &mut [u8]>>
       where Self: Immutable { ... }
    fn write_to_io<W>(&self, dst: W) -> Result<(), Error>
       where Self: Immutable,
             W: Write { ... }
}
Expand description

Types that can be converted to an immutable slice of initialized bytes.

Any IntoBytes type can be converted to a slice of initialized bytes of the same size. This is useful for efficiently serializing structured data as raw bytes.

§Implementation

Do not implement this trait yourself! Instead, use #[derive(IntoBytes)]; e.g.:

#[derive(IntoBytes)]
#[repr(C)]
struct MyStruct {
    ...
}

#[derive(IntoBytes)]
#[repr(u8)]
enum MyEnum {
    ...
}

This derive performs a sophisticated, compile-time safety analysis to determine whether a type is IntoBytes. See the derive documentation for guidance on how to interpret error messages produced by the derive’s analysis.

§Safety

This section describes what is required in order for T: IntoBytes, and what unsafe code may assume of such types. If you don’t plan on implementing IntoBytes manually, and you don’t plan on writing unsafe code that operates on IntoBytes types, then you don’t need to read this section.

If T: IntoBytes, then unsafe code may assume that it is sound to treat any t: T as an immutable [u8] of length size_of_val(t). If a type is marked as IntoBytes which violates this contract, it may cause undefined behavior.

#[derive(IntoBytes)] only permits types which satisfy these requirements.

Provided Methods§

Source

fn as_bytes(&self) -> &[u8] ⓘ
where Self: Immutable,

Gets the bytes of this value.

§Examples
use zerocopy::IntoBytes;

#[derive(IntoBytes, Immutable)]
#[repr(C)]
struct PacketHeader {
    src_port: [u8; 2],
    dst_port: [u8; 2],
    length: [u8; 2],
    checksum: [u8; 2],
}

let header = PacketHeader {
    src_port: [0, 1],
    dst_port: [2, 3],
    length: [4, 5],
    checksum: [6, 7],
};

let bytes = header.as_bytes();

assert_eq!(bytes, [0, 1, 2, 3, 4, 5, 6, 7]);
Source

fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
where Self: FromBytes,

Gets the bytes of this value mutably.

§Examples
use zerocopy::IntoBytes;

#[derive(FromBytes, IntoBytes, Immutable)]
#[repr(C)]
struct PacketHeader {
    src_port: [u8; 2],
    dst_port: [u8; 2],
    length: [u8; 2],
    checksum: [u8; 2],
}

let mut header = PacketHeader {
    src_port: [0, 1],
    dst_port: [2, 3],
    length: [4, 5],
    checksum: [6, 7],
};

let bytes = header.as_mut_bytes();

assert_eq!(bytes, [0, 1, 2, 3, 4, 5, 6, 7]);

bytes.reverse();

assert_eq!(header, PacketHeader {
    src_port: [7, 6],
    dst_port: [5, 4],
    length: [3, 2],
    checksum: [1, 0],
});
§ Code Generation

See IntoBytes::as_bytes.

Source

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst.

If dst.len() != size_of_val(self), write_to returns Err.

§Examples
use zerocopy::IntoBytes;

#[derive(IntoBytes, Immutable)]
#[repr(C)]
struct PacketHeader {
    src_port: [u8; 2],
    dst_port: [u8; 2],
    length: [u8; 2],
    checksum: [u8; 2],
}

let header = PacketHeader {
    src_port: [0, 1],
    dst_port: [2, 3],
    length: [4, 5],
    checksum: [6, 7],
};

let mut bytes = [0, 0, 0, 0, 0, 0, 0, 0];

header.write_to(&mut bytes[..]);

assert_eq!(bytes, [0, 1, 2, 3, 4, 5, 6, 7]);

If too many or too few target bytes are provided, write_to returns Err and leaves the target bytes unmodified:

let mut excessive_bytes = &mut [0u8; 128][..];

let write_result = header.write_to(excessive_bytes);

assert!(write_result.is_err());
assert_eq!(excessive_bytes, [0u8; 128]);
Source

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst.

write_to_prefix writes self to the first size_of_val(self) bytes of dst. If dst.len() < size_of_val(self), it returns Err.

§Examples
use zerocopy::IntoBytes;

#[derive(IntoBytes, Immutable)]
#[repr(C)]
struct PacketHeader {
    src_port: [u8; 2],
    dst_port: [u8; 2],
    length: [u8; 2],
    checksum: [u8; 2],
}

let header = PacketHeader {
    src_port: [0, 1],
    dst_port: [2, 3],
    length: [4, 5],
    checksum: [6, 7],
};

let mut bytes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];

header.write_to_prefix(&mut bytes[..]);

assert_eq!(bytes, [0, 1, 2, 3, 4, 5, 6, 7, 0, 0]);

If insufficient target bytes are provided, write_to_prefix returns Err and leaves the target bytes unmodified:

let mut insufficient_bytes = &mut [0, 0][..];

let write_result = header.write_to_suffix(insufficient_bytes);

assert!(write_result.is_err());
assert_eq!(insufficient_bytes, [0, 0]);
Source

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst.

write_to_suffix writes self to the last size_of_val(self) bytes of dst. If dst.len() < size_of_val(self), it returns Err.

§Examples
use zerocopy::IntoBytes;

#[derive(IntoBytes, Immutable)]
#[repr(C)]
struct PacketHeader {
    src_port: [u8; 2],
    dst_port: [u8; 2],
    length: [u8; 2],
    checksum: [u8; 2],
}

let header = PacketHeader {
    src_port: [0, 1],
    dst_port: [2, 3],
    length: [4, 5],
    checksum: [6, 7],
};

let mut bytes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];

header.write_to_suffix(&mut bytes[..]);

assert_eq!(bytes, [0, 0, 0, 1, 2, 3, 4, 5, 6, 7]);

let mut insufficient_bytes = &mut [0, 0][..];

let write_result = header.write_to_suffix(insufficient_bytes);

assert!(write_result.is_err());
assert_eq!(insufficient_bytes, [0, 0]);

If insufficient target bytes are provided, write_to_suffix returns Err and leaves the target bytes unmodified:

let mut insufficient_bytes = &mut [0, 0][..];

let write_result = header.write_to_suffix(insufficient_bytes);

assert!(write_result.is_err());
assert_eq!(insufficient_bytes, [0, 0]);
Source

fn write_to_io<W>(&self, dst: W) -> Result<(), Error>
where Self: Immutable, W: Write,

Writes a copy of self to an io::Write.

This is a shorthand for dst.write_all(self.as_bytes()), and is useful for interfacing with operating system byte sinks (files, sockets, etc.).

§Examples
use zerocopy::{byteorder::big_endian::U16, FromBytes, IntoBytes};
use std::fs::File;

#[derive(FromBytes, IntoBytes, Immutable, KnownLayout)]
#[repr(C, packed)]
struct GrayscaleImage {
    height: U16,
    width: U16,
    pixels: [U16],
}

let image = GrayscaleImage::ref_from_bytes(&[0, 0, 0, 0][..]).unwrap();
let mut file = File::create("image.bin").unwrap();
image.write_to_io(&mut file).unwrap();

If the write fails, write_to_io returns Err and a partial write may have occurred; e.g.:


let src = u128::MAX;
let mut dst = [0u8; 2];

let write_result = src.write_to_io(&mut dst[..]);

assert!(write_result.is_err());
assert_eq!(dst, [255, 255]);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoBytes for ()

Source§

impl IntoBytes for Atomic<bool>

Source§

impl IntoBytes for Atomic<i8>

Source§

impl IntoBytes for Atomic<i16>

Source§

impl IntoBytes for Atomic<i32>

Source§

impl IntoBytes for Atomic<i64>

Source§

impl IntoBytes for Atomic<isize>

Source§

impl IntoBytes for Atomic<u8>

Source§

impl IntoBytes for Atomic<u16>

Source§

impl IntoBytes for Atomic<u32>

Source§

impl IntoBytes for Atomic<u64>

Source§

impl IntoBytes for Atomic<usize>

§

impl IntoBytes for HandleCountInfo
where u32: IntoBytes,

§

impl IntoBytes for InfoMapsTypeUnion
where zx_info_maps_mapping_t: IntoBytes, (): PaddingFree<InfoMapsTypeUnion, zx_types::::_#263::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for InfoMapsTypeUnionV1
where zx_info_maps_mapping_v1_t: IntoBytes, (): PaddingFree<InfoMapsTypeUnionV1, zx_types::::_#288::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for InfoMapsTypeUnionV2
where zx_info_maps_mapping_v2_t: IntoBytes, (): PaddingFree<InfoMapsTypeUnionV2, zx_types::::_#274::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for MemStats
where u64: IntoBytes, (): PaddingFree<MemStats, zx::::resource::_#2::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for MemStatsCompression
where u64: IntoBytes, i64: IntoBytes, [u64; 8]: IntoBytes, (): PaddingFree<MemStatsCompression, zx::::resource::_#8::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for MemStatsExtended
where u64: IntoBytes, (): PaddingFree<MemStatsExtended, zx::::resource::_#5::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for MemoryStall
where i64: IntoBytes, (): PaddingFree<MemoryStall, zx::::resource::_#17::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for Name
where [u8; 32]: IntoBytes,

Source§

impl IntoBytes for NonZero<i8>

Source§

impl IntoBytes for NonZero<i16>

Source§

impl IntoBytes for NonZero<i32>

Source§

impl IntoBytes for NonZero<i64>

Source§

impl IntoBytes for NonZero<i128>

Source§

impl IntoBytes for NonZero<isize>

Source§

impl IntoBytes for NonZero<u8>

Source§

impl IntoBytes for NonZero<u16>

Source§

impl IntoBytes for NonZero<u32>

Source§

impl IntoBytes for NonZero<u64>

Source§

impl IntoBytes for NonZero<u128>

Source§

impl IntoBytes for NonZero<usize>

Source§

impl IntoBytes for Option<NonZero<i8>>

Source§

impl IntoBytes for Option<NonZero<i16>>

Source§

impl IntoBytes for Option<NonZero<i32>>

Source§

impl IntoBytes for Option<NonZero<i64>>

Source§

impl IntoBytes for Option<NonZero<i128>>

Source§

impl IntoBytes for Option<NonZero<isize>>

Source§

impl IntoBytes for Option<NonZero<u8>>

Source§

impl IntoBytes for Option<NonZero<u16>>

Source§

impl IntoBytes for Option<NonZero<u32>>

Source§

impl IntoBytes for Option<NonZero<u64>>

Source§

impl IntoBytes for Option<NonZero<u128>>

Source§

impl IntoBytes for Option<NonZero<usize>>

§

impl IntoBytes for PadByte
where u8: IntoBytes,

§

impl IntoBytes for PerCpuStats
where u32: IntoBytes, i64: IntoBytes, u64: IntoBytes, (): PaddingFree<PerCpuStats, zx::::resource::_#11::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for ProcessHandleStats
where [u32; 64]: IntoBytes,

§

impl IntoBytes for ResourceInfo
where u32: IntoBytes, u64: IntoBytes, usize: IntoBytes, [u8; 32]: IntoBytes, (): PaddingFree<ResourceInfo, zx::::resource::_#14::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for TaskRuntimeInfo
where i64: IntoBytes, (): PaddingFree<TaskRuntimeInfo, zx::::task::_#3::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for TaskStatsInfo
where usize: IntoBytes, u64: IntoBytes, (): PaddingFree<TaskStatsInfo, zx::::process::_#14::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for VmarInfo
where usize: IntoBytes, (): PaddingFree<VmarInfo, zx::::vmar::_#2::_::{impl#0}::{constant#0}>,

Source§

impl IntoBytes for __m128

Source§

impl IntoBytes for __m256

Source§

impl IntoBytes for __m512

Source§

impl IntoBytes for __m128d

Source§

impl IntoBytes for __m128i

Source§

impl IntoBytes for __m256d

Source§

impl IntoBytes for __m256i

Source§

impl IntoBytes for __m512bh

Source§

impl IntoBytes for __m512d

Source§

impl IntoBytes for __m512i

Source§

impl IntoBytes for bool

Source§

impl IntoBytes for char

Source§

impl IntoBytes for f32

Source§

impl IntoBytes for f64

Source§

impl IntoBytes for i8

Source§

impl IntoBytes for i16

Source§

impl IntoBytes for i32

Source§

impl IntoBytes for i64

Source§

impl IntoBytes for i128

Source§

impl IntoBytes for isize

Source§

impl IntoBytes for str

Source§

impl IntoBytes for u8

Source§

impl IntoBytes for u16

Source§

impl IntoBytes for u32

Source§

impl IntoBytes for u64

Source§

impl IntoBytes for u128

Source§

impl IntoBytes for usize

§

impl IntoBytes for zx_arm64_exc_data_t
where u32: IntoBytes, [PadByte; 4]: IntoBytes, u64: IntoBytes, [PadByte; 8]: IntoBytes, (): PaddingFree<zx_arm64_exc_data_t, zx_types::::_#61::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_arm64_info_guest_stats_t
where u32: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_arm64_info_guest_stats_t, zx_types::::_#189::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_clock_create_args_v1_t
where i64: IntoBytes,

§

impl IntoBytes for zx_clock_details_v1_t
where u64: IntoBytes, i64: IntoBytes, zx_clock_transformation_t: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_clock_details_v1_t, zx_types::::_#17::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_clock_rate_t
where u32: IntoBytes, (): PaddingFree<zx_clock_rate_t, zx_types::::_#9::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_clock_transformation_t
where i64: IntoBytes, zx_clock_rate_t: IntoBytes, (): PaddingFree<zx_clock_transformation_t, zx_types::::_#13::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_clock_update_args_v1_t
where i32: IntoBytes, [PadByte; 4]: IntoBytes, i64: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_clock_update_args_v1_t, zx_types::::_#21::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_clock_update_args_v2_t
where i32: IntoBytes, [PadByte; 4]: IntoBytes, i64: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_clock_update_args_v2_t, zx_types::::_#25::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_cpu_perf_limit_t
where u32: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_cpu_perf_limit_t, zx_types::::_#346::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_cpu_performance_info_t
where u32: IntoBytes, zx_cpu_performance_scale_t: IntoBytes, (): PaddingFree<zx_cpu_performance_info_t, zx_types::::_#342::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_cpu_performance_scale_t
where u32: IntoBytes, (): PaddingFree<zx_cpu_performance_scale_t, zx_types::::_#338::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_cpu_set_t
where [u64; 8]: IntoBytes,

§

impl IntoBytes for zx_exception_context_t
where zx_exception_header_arch_t: IntoBytes, u32: IntoBytes, (): PaddingFree<zx_exception_context_t, zx_types::::_#77::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_exception_header_arch_t
where zx_x86_64_exc_data_t: IntoBytes, zx_arm64_exc_data_t: IntoBytes, zx_riscv64_exc_data_t: IntoBytes, (): PaddingFree<zx_exception_header_arch_t, zx_types::::_#69::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_exception_header_t
where u32: IntoBytes, (): PaddingFree<zx_exception_header_t, zx_types::::_#73::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_exception_info_t
where u64: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_exception_info_t, zx_types::::_#53::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_exception_report_t
where zx_exception_header_t: IntoBytes, zx_exception_context_t: IntoBytes, (): PaddingFree<zx_exception_report_t, zx_types::::_#81::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_exception_report_v1_t
where zx_exception_header_t: IntoBytes, [u8; 24]: IntoBytes, (): PaddingFree<zx_exception_report_v1_t, zx_types::::_#87::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_bti_t
where u64: IntoBytes, (): PaddingFree<zx_info_bti_t, zx_types::::_#216::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_cpu_stats_t
where u32: IntoBytes, i64: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_info_cpu_stats_t, zx_types::::_#186::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_handle_basic_t
where u64: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_info_handle_basic_t, zx_types::::_#103::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_handle_count_t
where u32: IntoBytes,

§

impl IntoBytes for zx_info_handle_extended_t
where u32: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_info_handle_extended_t, zx_types::::_#109::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_interrupt_t
where u32: IntoBytes,

§

impl IntoBytes for zx_info_iob_t
where u64: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_info_iob_t, zx_types::::_#122::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_job_t
where i64: IntoBytes, u8: IntoBytes, [PadByte; 5]: IntoBytes, (): PaddingFree<zx_info_job_t, zx_types::::_#141::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_kmem_stats_compression_t
where u64: IntoBytes, i64: IntoBytes, [u64; 8]: IntoBytes, (): PaddingFree<zx_info_kmem_stats_compression_t, zx_types::::_#212::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_kmem_stats_extended_t
where u64: IntoBytes, (): PaddingFree<zx_info_kmem_stats_extended_t, zx_types::::_#209::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_kmem_stats_t
where u64: IntoBytes, (): PaddingFree<zx_info_kmem_stats_t, zx_types::::_#201::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_kmem_stats_v1_t
where u64: IntoBytes, (): PaddingFree<zx_info_kmem_stats_v1_t, zx_types::::_#204::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_maps_mapping_t
where u32: IntoBytes, [PadByte; 4]: IntoBytes, u64: IntoBytes, usize: IntoBytes, (): PaddingFree<zx_info_maps_mapping_t, zx_types::::_#260::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_maps_mapping_v1_t
where u32: IntoBytes, [PadByte; 4]: IntoBytes, u64: IntoBytes, usize: IntoBytes, (): PaddingFree<zx_info_maps_mapping_v1_t, zx_types::::_#284::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_maps_mapping_v2_t
where u32: IntoBytes, [PadByte; 4]: IntoBytes, u64: IntoBytes, usize: IntoBytes, (): PaddingFree<zx_info_maps_mapping_v2_t, zx_types::::_#270::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_maps_t
where [u8; 32]: IntoBytes, usize: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, InfoMapsTypeUnion: IntoBytes, (): PaddingFree<zx_info_maps_t, zx_types::::_#267::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_info_maps_v1_t
where [u8; 32]: IntoBytes, usize: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, InfoMapsTypeUnionV1: IntoBytes, (): PaddingFree<zx_info_maps_v1_t, zx_types::::_#292::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_info_maps_v2_t
where [u8; 32]: IntoBytes, usize: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, InfoMapsTypeUnionV2: IntoBytes, (): PaddingFree<zx_info_maps_v2_t, zx_types::::_#278::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_info_memory_stall_t
where i64: IntoBytes, (): PaddingFree<zx_info_memory_stall_t, zx_types::::_#303::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_msi_t
where u64: IntoBytes, u32: IntoBytes, (): PaddingFree<zx_info_msi_t, zx_types::::_#219::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_process_handle_stats_t
where [u32; 64]: IntoBytes,

§

impl IntoBytes for zx_info_process_t
where i64: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_info_process_t, zx_types::::_#138::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_resource_t
where u32: IntoBytes, u64: IntoBytes, usize: IntoBytes, [u8; 32]: IntoBytes, (): PaddingFree<zx_info_resource_t, zx_types::::_#232::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_socket_t
where u32: IntoBytes, [PadByte; 4]: IntoBytes, usize: IntoBytes, (): PaddingFree<zx_info_socket_t, zx_types::::_#116::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_stream_t
where u32: IntoBytes, [u8; 4]: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_info_stream_t, zx_types::::_#148::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_task_runtime_t
where i64: IntoBytes, (): PaddingFree<zx_info_task_runtime_t, zx_types::::_#250::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_task_runtime_v1_t
where i64: IntoBytes, (): PaddingFree<zx_info_task_runtime_v1_t, zx_types::::_#255::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_task_stats_t
where usize: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_info_task_stats_t, zx_types::::_#240::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_task_stats_v1_t
where usize: IntoBytes, (): PaddingFree<zx_info_task_stats_v1_t, zx_types::::_#245::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_thread_stats_t
where i64: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_info_thread_stats_t, zx_types::::_#227::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_info_thread_t
where u32: IntoBytes, zx_cpu_set_t: IntoBytes, (): PaddingFree<zx_info_thread_t, zx_types::::_#223::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_timer_t
where u32: IntoBytes, i64: IntoBytes, (): PaddingFree<zx_info_timer_t, zx_types::::_#145::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_vcpu_t
where u32: IntoBytes,

§

impl IntoBytes for zx_info_vmar_t
where usize: IntoBytes, (): PaddingFree<zx_info_vmar_t, zx_types::::_#235::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_info_vmo_t
where u64: IntoBytes, [u8; 32]: IntoBytes, usize: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_info_vmo_t, zx_types::::_#165::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_info_vmo_v1_t
where u64: IntoBytes, [u8; 32]: IntoBytes, usize: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_info_vmo_v1_t, zx_types::::_#169::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_info_vmo_v2_t
where u64: IntoBytes, [u8; 32]: IntoBytes, usize: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_info_vmo_v2_t, zx_types::::_#175::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_info_vmo_v3_t
where u64: IntoBytes, [u8; 32]: IntoBytes, usize: IntoBytes, u32: IntoBytes, [PadByte; 4]: IntoBytes, (): PaddingFree<zx_info_vmo_v3_t, zx_types::::_#181::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_iob_discipline_extension_t
where zx_iob_discipline_mediated_write_ring_buffer_t: IntoBytes, [PadByte; 64]: IntoBytes, (): PaddingFree<zx_iob_discipline_extension_t, zx_types::::_#362::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_iob_discipline_mediated_write_ring_buffer_t
where u64: IntoBytes, [PadByte; 56]: IntoBytes, (): PaddingFree<zx_iob_discipline_mediated_write_ring_buffer_t, zx_types::::_#366::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_iob_discipline_t
where u64: IntoBytes, zx_iob_discipline_extension_t: IntoBytes, (): PaddingFree<zx_iob_discipline_t, zx_types::::_#358::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_iob_region_extension_t
where zx_iob_region_private_t: IntoBytes, zx_iob_region_shared_t: IntoBytes, [u8; 32]: IntoBytes, (): PaddingFree<zx_iob_region_extension_t, zx_types::::_#378::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_iob_region_info_t
where zx_iob_region_t: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_iob_region_info_t, zx_types::::_#126::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_iob_region_private_t
where u32: IntoBytes, [PadByte; 28]: IntoBytes, (): PaddingFree<zx_iob_region_private_t, zx_types::::_#370::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_iob_region_shared_t
where u32: IntoBytes, [PadByte; 24]: IntoBytes, (): PaddingFree<zx_iob_region_shared_t, zx_types::::_#374::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_iob_region_t
where u32: IntoBytes, u64: IntoBytes, zx_iob_discipline_t: IntoBytes, zx_iob_region_extension_t: IntoBytes, (): PaddingFree<zx_iob_region_t, zx_types::::_#354::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_log_record_header_t
where u64: IntoBytes, [PadByte; 4]: IntoBytes, u16: IntoBytes, u8: IntoBytes, i64: IntoBytes, (): PaddingFree<zx_log_record_header_t, zx_types::::_#305::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_log_record_t
where zx_log_record_header_t: IntoBytes, [u8; 216]: IntoBytes, (): PaddingFree<zx_log_record_t, zx_types::::_#308::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_packet_type_t
where (): PaddingFree<zx_packet_type_t, zx_types::::_#32::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_pager_vmo_stats_t
where u32: IntoBytes,

§

impl IntoBytes for zx_policy_basic_v1
where u32: IntoBytes, (): PaddingFree<zx_policy_basic_v1, zx_types::::_#151::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_policy_basic_v2
where u32: IntoBytes, (): PaddingFree<zx_policy_basic_v2, zx_types::::_#155::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_policy_timer_slack
where i64: IntoBytes, u32: IntoBytes, [u8; 4]: IntoBytes, (): PaddingFree<zx_policy_timer_slack, zx_types::::_#159::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_port_packet_t
where u64: IntoBytes, zx_packet_type_t: IntoBytes, i32: IntoBytes, [u8; 32]: IntoBytes, (): PaddingFree<zx_port_packet_t, zx_types::::_#35::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_riscv64_exc_data_t
where u64: IntoBytes, [PadByte; 8]: IntoBytes, (): PaddingFree<zx_riscv64_exc_data_t, zx_types::::_#65::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_riscv64_info_guest_stats_t
where u32: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_riscv64_info_guest_stats_t, zx_types::::_#197::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_rseq_t
where u32: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_rseq_t, zx_types::::_#388::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_sampler_config_t
where i64: IntoBytes, usize: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_sampler_config_t, zx_types::::_#350::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_sched_deadline_params_t
where i64: IntoBytes, (): PaddingFree<zx_sched_deadline_params_t, zx_types::::_#334::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_smc_parameters_t
where u32: IntoBytes, [PadByte; 4]: IntoBytes, u64: IntoBytes, u16: IntoBytes, (): PaddingFree<zx_smc_parameters_t, zx_types::::_#312::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_smc_result_t
where u64: IntoBytes, (): PaddingFree<zx_smc_result_t, zx_types::::_#316::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_vcpu_io_t
where u8: IntoBytes, [PadByte; 3]: IntoBytes, [u8; 4]: IntoBytes, (): PaddingFree<zx_vcpu_io_t, zx_types::::_#99::_::{impl#0}::{constant#2}>,

§

impl IntoBytes for zx_vcpu_state_t
where u64: IntoBytes, (): PaddingFree<zx_vcpu_state_t, zx_types::::_#95::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_vmo_dirty_range_t
where u64: IntoBytes, (): PaddingFree<zx_vmo_dirty_range_t, zx_types::::_#49::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_vmo_lock_state_t
where u64: IntoBytes, (): PaddingFree<zx_vmo_lock_state_t, zx_types::::_#322::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_wait_item_t
where u32: IntoBytes, (): PaddingFree<zx_wait_item_t, zx_types::::_#30::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_wake_source_report_entry_t
where u64: IntoBytes, [u8; 32]: IntoBytes, i64: IntoBytes, u32: IntoBytes, (): PaddingFree<zx_wake_source_report_entry_t, zx_types::::_#381::_::{impl#0}::{constant#1}>,

§

impl IntoBytes for zx_wake_source_report_header_t
where i64: IntoBytes, u32: IntoBytes, (): PaddingFree<zx_wake_source_report_header_t, zx_types::::_#384::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_x86_64_exc_data_t
where u64: IntoBytes, (): PaddingFree<zx_x86_64_exc_data_t, zx_types::::_#57::_::{impl#0}::{constant#0}>,

§

impl IntoBytes for zx_x86_64_info_guest_stats_t
where u32: IntoBytes, u64: IntoBytes, (): PaddingFree<zx_x86_64_info_guest_stats_t, zx_types::::_#193::_::{impl#0}::{constant#0}>,

§

impl<T, U> IntoBytes for Duration<T, U>

§

impl<T, U> IntoBytes for Instant<T, U>

Source§

impl<T, const N: usize> IntoBytes for [T; N]
where T: IntoBytes,

Source§

impl<T> IntoBytes for Cell<T>
where T: IntoBytes + ?Sized,

Source§

impl<T> IntoBytes for ManuallyDrop<T>
where T: IntoBytes + ?Sized,

Source§

impl<T> IntoBytes for PhantomData<T>
where T: ?Sized,

Source§

impl<T> IntoBytes for UnsafeCell<T>
where T: IntoBytes + ?Sized,

Source§

impl<T> IntoBytes for Wrapping<T>
where T: IntoBytes,

Source§

impl<T> IntoBytes for [T]
where T: IntoBytes,

Implementors§

Source§

impl<O> IntoBytes for F32<O>

Source§

impl<O> IntoBytes for F64<O>

Source§

impl<O> IntoBytes for I16<O>

Source§

impl<O> IntoBytes for I32<O>

Source§

impl<O> IntoBytes for I64<O>

Source§

impl<O> IntoBytes for I128<O>

Source§

impl<O> IntoBytes for Isize<O>

Source§

impl<O> IntoBytes for U16<O>

Source§

impl<O> IntoBytes for U32<O>

Source§

impl<O> IntoBytes for U64<O>

Source§

impl<O> IntoBytes for U128<O>

Source§

impl<O> IntoBytes for Usize<O>

Source§

impl<T> IntoBytes for ReadOnly<T>
where T: IntoBytes + ?Sized,

Source§

impl<T> IntoBytes for Unalign<T>
where T: IntoBytes,