Trait TryFromBytes

Source
pub unsafe trait TryFromBytes {
Show 15 methods // Provided methods fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, TryCastError<&[u8], Self>> where Self: KnownLayout + Immutable { ... } fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), TryCastError<&[u8], Self>> where Self: KnownLayout + Immutable { ... } fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), TryCastError<&[u8], Self>> where Self: KnownLayout + Immutable { ... } fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, TryCastError<&mut [u8], Self>> where Self: KnownLayout + IntoBytes { ... } fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), TryCastError<&mut [u8], Self>> where Self: KnownLayout + IntoBytes { ... } fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), TryCastError<&mut [u8], Self>> where Self: KnownLayout + IntoBytes { ... } fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, TryCastError<&[u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + Immutable { ... } fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), TryCastError<&[u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + Immutable { ... } fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), TryCastError<&[u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + Immutable { ... } fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, TryCastError<&mut [u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + IntoBytes { ... } fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), TryCastError<&mut [u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + IntoBytes { ... } fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), TryCastError<&mut [u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + IntoBytes { ... } fn try_read_from_bytes( source: &[u8], ) -> Result<Self, TryReadError<&[u8], Self>> where Self: Sized { ... } fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), TryReadError<&[u8], Self>> where Self: Sized { ... } fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), TryReadError<&[u8], Self>> where Self: Sized { ... }
}
Expand description

Types for which some bit patterns are valid.

A memory region of the appropriate length which contains initialized bytes can be viewed as a TryFromBytes type so long as the runtime value of those bytes corresponds to a valid instance of that type. For example, bool is TryFromBytes, so zerocopy can transmute a u8 into a bool so long as it first checks that the value of the u8 is 0 or 1.

§Implementation

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

#[derive(TryFromBytes)]
struct MyStruct {
    ...
}

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

#[derive(TryFromBytes, Immutable)]
union MyUnion {
    ...
}

This derive ensures that the runtime check of whether bytes correspond to a valid instance is sound. You must implement this trait via the derive.

§What is a “valid instance”?

In Rust, each type has bit validity, which refers to the set of bit patterns which may appear in an instance of that type. It is impossible for safe Rust code to produce values which violate bit validity (ie, values outside of the “valid” set of bit patterns). If unsafe code produces an invalid value, this is considered undefined behavior.

Rust’s bit validity rules are currently being decided, which means that some types have three classes of bit patterns: those which are definitely valid, and whose validity is documented in the language; those which may or may not be considered valid at some point in the future; and those which are definitely invalid.

Zerocopy takes a conservative approach, and only considers a bit pattern to be valid if its validity is a documenteed guarantee provided by the language.

For most use cases, Rust’s current guarantees align with programmers’ intuitions about what ought to be valid. As a result, zerocopy’s conservatism should not affect most users.

If you are negatively affected by lack of support for a particular type, we encourage you to let us know by filing an issue.

§TryFromBytes is not symmetrical with IntoBytes

There are some types which implement both TryFromBytes and IntoBytes, but for which TryFromBytes is not guaranteed to accept all byte sequences produced by IntoBytes. In other words, for some T: TryFromBytes + IntoBytes, there exist values of t: T such that TryFromBytes::try_ref_from_bytes(t.as_bytes()) == None. Code should not generally assume that values produced by IntoBytes will necessarily be accepted as valid by TryFromBytes.

§Safety

On its own, T: TryFromBytes does not make any guarantees about the layout or representation of T. It merely provides the ability to perform a validity check at runtime via methods like try_ref_from_bytes.

You must not rely on the #[doc(hidden)] internals of TryFromBytes. Future releases of zerocopy may make backwards-breaking changes to these items, including changes that only affect soundness, which may cause code which uses those items to silently become unsound.

Provided Methods§

Source

fn try_ref_from_bytes(source: &[u8]) -> Result<&Self, TryCastError<&[u8], Self>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self.

If the bytes of source are a valid instance of Self, this method returns a reference to those bytes interpreted as a Self. If the length of source is not a valid size of Self, or if source is not appropriately aligned, or if source is not a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

Self may be a sized type, a slice, or a slice DST.

§Compile-Time Assertions

This method cannot yet be used on unsized types whose dynamically-sized component is zero-sized. Attempting to use this method on such types results in a compile-time assertion error; e.g.:

use zerocopy::*;

#[derive(TryFromBytes, Immutable, KnownLayout)]
#[repr(C)]
struct ZSTy {
    leading_sized: u16,
    trailing_dst: [()],
}

let _ = ZSTy::try_ref_from_bytes(0u16.as_bytes()); // ⚠ Compile Error!
§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the byte sequence `0xC0C0`.
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

let bytes = &[0xC0, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5][..];

let packet = Packet::try_ref_from_bytes(bytes).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[0, 1], [2, 3], [4, 5]]);

// These bytes are not valid instance of `Packet`.
let bytes = &[0x10, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5][..];
assert!(Packet::try_ref_from_bytes(bytes).is_err());
Source

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), TryCastError<&[u8], Self>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self.

This method computes the largest possible size of Self that can fit in the leading bytes of source. If that prefix is a valid instance of Self, this method returns a reference to those bytes interpreted as Self, and a reference to the remaining bytes. If there are insufficient bytes, or if source is not appropriately aligned, or if those bytes are not a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

Self may be a sized type, a slice, or a slice DST.

§Compile-Time Assertions

This method cannot yet be used on unsized types whose dynamically-sized component is zero-sized. Attempting to use this method on such types results in a compile-time assertion error; e.g.:

use zerocopy::*;

#[derive(TryFromBytes, Immutable, KnownLayout)]
#[repr(C)]
struct ZSTy {
    leading_sized: u16,
    trailing_dst: [()],
}

let _ = ZSTy::try_ref_from_prefix(0u16.as_bytes()); // ⚠ Compile Error!
§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

// These are more bytes than are needed to encode a `Packet`.
let bytes = &[0xC0, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5, 6][..];

let (packet, suffix) = Packet::try_ref_from_prefix(bytes).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[0, 1], [2, 3], [4, 5]]);
assert_eq!(suffix, &[6u8][..]);

// These bytes are not valid instance of `Packet`.
let bytes = &[0x10, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5, 6][..];
assert!(Packet::try_ref_from_prefix(bytes).is_err());
Source

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), TryCastError<&[u8], Self>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self.

This method computes the largest possible size of Self that can fit in the trailing bytes of source. If that suffix is a valid instance of Self, this method returns a reference to those bytes interpreted as Self, and a reference to the preceding bytes. If there are insufficient bytes, or if the suffix of source would not be appropriately aligned, or if the suffix is not a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

Self may be a sized type, a slice, or a slice DST.

§Compile-Time Assertions

This method cannot yet be used on unsized types whose dynamically-sized component is zero-sized. Attempting to use this method on such types results in a compile-time assertion error; e.g.:

use zerocopy::*;

#[derive(TryFromBytes, Immutable, KnownLayout)]
#[repr(C)]
struct ZSTy {
    leading_sized: u16,
    trailing_dst: [()],
}

let _ = ZSTy::try_ref_from_suffix(0u16.as_bytes()); // ⚠ Compile Error!
§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

// These are more bytes than are needed to encode a `Packet`.
let bytes = &[0, 0xC0, 0xC0, 240, 77, 2, 3, 4, 5, 6, 7][..];

let (prefix, packet) = Packet::try_ref_from_suffix(bytes).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[2, 3], [4, 5], [6, 7]]);
assert_eq!(prefix, &[0u8][..]);

// These bytes are not valid instance of `Packet`.
let bytes = &[0, 1, 2, 3, 4, 5, 6, 77, 240, 0xC0, 0x10][..];
assert!(Packet::try_ref_from_suffix(bytes).is_err());
Source

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, TryCastError<&mut [u8], Self>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying.

If the bytes of source are a valid instance of Self, this method returns a reference to those bytes interpreted as a Self. If the length of source is not a valid size of Self, or if source is not appropriately aligned, or if source is not a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

Self may be a sized type, a slice, or a slice DST.

§Compile-Time Assertions

This method cannot yet be used on unsized types whose dynamically-sized component is zero-sized. Attempting to use this method on such types results in a compile-time assertion error; e.g.:

use zerocopy::*;

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct ZSTy {
    leading_sized: [u8; 2],
    trailing_dst: [()],
}

let mut source = [85, 85];
let _ = ZSTy::try_mut_from_bytes(&mut source[..]); // ⚠ Compile Error!
§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

let bytes = &mut [0xC0, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5][..];

let packet = Packet::try_mut_from_bytes(bytes).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[0, 1], [2, 3], [4, 5]]);

packet.temperature = 111;

assert_eq!(bytes, [0xC0, 0xC0, 240, 111, 0, 1, 2, 3, 4, 5]);

// These bytes are not valid instance of `Packet`.
let bytes = &mut [0x10, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5, 6][..];
assert!(Packet::try_mut_from_bytes(bytes).is_err());
Source

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), TryCastError<&mut [u8], Self>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self.

This method computes the largest possible size of Self that can fit in the leading bytes of source. If that prefix is a valid instance of Self, this method returns a reference to those bytes interpreted as Self, and a reference to the remaining bytes. If there are insufficient bytes, or if source is not appropriately aligned, or if the bytes are not a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

Self may be a sized type, a slice, or a slice DST.

§Compile-Time Assertions

This method cannot yet be used on unsized types whose dynamically-sized component is zero-sized. Attempting to use this method on such types results in a compile-time assertion error; e.g.:

use zerocopy::*;

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct ZSTy {
    leading_sized: [u8; 2],
    trailing_dst: [()],
}

let mut source = [85, 85];
let _ = ZSTy::try_mut_from_prefix(&mut source[..]); // ⚠ Compile Error!
§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

// These are more bytes than are needed to encode a `Packet`.
let bytes = &mut [0xC0, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5, 6][..];

let (packet, suffix) = Packet::try_mut_from_prefix(bytes).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[0, 1], [2, 3], [4, 5]]);
assert_eq!(suffix, &[6u8][..]);

packet.temperature = 111;
suffix[0] = 222;

assert_eq!(bytes, [0xC0, 0xC0, 240, 111, 0, 1, 2, 3, 4, 5, 222]);

// These bytes are not valid instance of `Packet`.
let bytes = &mut [0x10, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5, 6][..];
assert!(Packet::try_mut_from_prefix(bytes).is_err());
Source

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), TryCastError<&mut [u8], Self>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self.

This method computes the largest possible size of Self that can fit in the trailing bytes of source. If that suffix is a valid instance of Self, this method returns a reference to those bytes interpreted as Self, and a reference to the preceding bytes. If there are insufficient bytes, or if the suffix of source would not be appropriately aligned, or if the suffix is not a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

Self may be a sized type, a slice, or a slice DST.

§Compile-Time Assertions

This method cannot yet be used on unsized types whose dynamically-sized component is zero-sized. Attempting to use this method on such types results in a compile-time assertion error; e.g.:

use zerocopy::*;

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct ZSTy {
    leading_sized: u16,
    trailing_dst: [()],
}

let mut source = [85, 85];
let _ = ZSTy::try_mut_from_suffix(&mut source[..]); // ⚠ Compile Error!
§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

// These are more bytes than are needed to encode a `Packet`.
let bytes = &mut [0, 0xC0, 0xC0, 240, 77, 2, 3, 4, 5, 6, 7][..];

let (prefix, packet) = Packet::try_mut_from_suffix(bytes).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[2, 3], [4, 5], [6, 7]]);
assert_eq!(prefix, &[0u8][..]);

prefix[0] = 111;
packet.temperature = 222;

assert_eq!(bytes, [111, 0xC0, 0xC0, 240, 222, 2, 3, 4, 5, 6, 7]);

// These bytes are not valid instance of `Packet`.
let bytes = &mut [0, 1, 2, 3, 4, 5, 6, 77, 240, 0xC0, 0x10][..];
assert!(Packet::try_mut_from_suffix(bytes).is_err());
Source

fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, TryCastError<&[u8], Self>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the given source as a &Self with a DST length equal to count.

This method attempts to return a reference to source interpreted as a Self with count trailing elements. If the length of source is not equal to the size of Self with count elements, if source is not appropriately aligned, or if source does not contain a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

let bytes = &[0xC0, 0xC0, 240, 77, 2, 3, 4, 5, 6, 7][..];

let packet = Packet::try_ref_from_bytes_with_elems(bytes, 3).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[2, 3], [4, 5], [6, 7]]);

// These bytes are not valid instance of `Packet`.
let bytes = &[0, 1, 2, 3, 4, 5, 6, 77, 240, 0xC0, 0xC0][..];
assert!(Packet::try_ref_from_bytes_with_elems(bytes, 3).is_err());

Since an explicit count is provided, this method supports types with zero-sized trailing slice elements. Methods such as try_ref_from_bytes which do not take an explicit count do not support such types.

use core::num::NonZeroU16;
use zerocopy::*;

#[derive(TryFromBytes, Immutable, KnownLayout)]
#[repr(C)]
struct ZSTy {
    leading_sized: NonZeroU16,
    trailing_dst: [()],
}

let src = 0xCAFEu16.as_bytes();
let zsty = ZSTy::try_ref_from_bytes_with_elems(src, 42).unwrap();
assert_eq!(zsty.trailing_dst.len(), 42);
Source

fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), TryCastError<&[u8], Self>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the prefix of the given source as a &Self with a DST length equal to count.

This method attempts to return a reference to the prefix of source interpreted as a Self with count trailing elements, and a reference to the remaining bytes. If the length of source is less than the size of Self with count elements, if source is not appropriately aligned, or if the prefix of source does not contain a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

let bytes = &[0xC0, 0xC0, 240, 77, 2, 3, 4, 5, 6, 7, 8][..];

let (packet, suffix) = Packet::try_ref_from_prefix_with_elems(bytes, 3).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[2, 3], [4, 5], [6, 7]]);
assert_eq!(suffix, &[8u8][..]);

// These bytes are not valid instance of `Packet`.
let bytes = &mut [0, 1, 2, 3, 4, 5, 6, 7, 8, 77, 240, 0xC0, 0xC0][..];
assert!(Packet::try_ref_from_prefix_with_elems(bytes, 3).is_err());

Since an explicit count is provided, this method supports types with zero-sized trailing slice elements. Methods such as try_ref_from_prefix which do not take an explicit count do not support such types.

use core::num::NonZeroU16;
use zerocopy::*;

#[derive(TryFromBytes, Immutable, KnownLayout)]
#[repr(C)]
struct ZSTy {
    leading_sized: NonZeroU16,
    trailing_dst: [()],
}

let src = 0xCAFEu16.as_bytes();
let (zsty, _) = ZSTy::try_ref_from_prefix_with_elems(src, 42).unwrap();
assert_eq!(zsty.trailing_dst.len(), 42);
Source

fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), TryCastError<&[u8], Self>>
where Self: KnownLayout<PointerMetadata = usize> + Immutable,

Attempts to interpret the suffix of the given source as a &Self with a DST length equal to count.

This method attempts to return a reference to the suffix of source interpreted as a Self with count trailing elements, and a reference to the preceding bytes. If the length of source is less than the size of Self with count elements, if the suffix of source is not appropriately aligned, or if the suffix of source does not contain a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, KnownLayout, Immutable)]
#[repr(C)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

let bytes = &[123, 0xC0, 0xC0, 240, 77, 2, 3, 4, 5, 6, 7][..];

let (prefix, packet) = Packet::try_ref_from_suffix_with_elems(bytes, 3).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[2, 3], [4, 5], [6, 7]]);
assert_eq!(prefix, &[123u8][..]);

// These bytes are not valid instance of `Packet`.
let bytes = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 77, 240, 0xC0, 0xC0][..];
assert!(Packet::try_ref_from_suffix_with_elems(bytes, 3).is_err());

Since an explicit count is provided, this method supports types with zero-sized trailing slice elements. Methods such as try_ref_from_prefix which do not take an explicit count do not support such types.

use core::num::NonZeroU16;
use zerocopy::*;

#[derive(TryFromBytes, Immutable, KnownLayout)]
#[repr(C)]
struct ZSTy {
    leading_sized: NonZeroU16,
    trailing_dst: [()],
}

let src = 0xCAFEu16.as_bytes();
let (_, zsty) = ZSTy::try_ref_from_suffix_with_elems(src, 42).unwrap();
assert_eq!(zsty.trailing_dst.len(), 42);
Source

fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, TryCastError<&mut [u8], Self>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the given source as a &mut Self with a DST length equal to count.

This method attempts to return a reference to source interpreted as a Self with count trailing elements. If the length of source is not equal to the size of Self with count elements, if source is not appropriately aligned, or if source does not contain a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

let bytes = &mut [0xC0, 0xC0, 240, 77, 2, 3, 4, 5, 6, 7][..];

let packet = Packet::try_mut_from_bytes_with_elems(bytes, 3).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[2, 3], [4, 5], [6, 7]]);

packet.temperature = 111;

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

// These bytes are not valid instance of `Packet`.
let bytes = &mut [0, 1, 2, 3, 4, 5, 6, 77, 240, 0xC0, 0xC0][..];
assert!(Packet::try_mut_from_bytes_with_elems(bytes, 3).is_err());

Since an explicit count is provided, this method supports types with zero-sized trailing slice elements. Methods such as try_mut_from_bytes which do not take an explicit count do not support such types.

use core::num::NonZeroU16;
use zerocopy::*;

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct ZSTy {
    leading_sized: NonZeroU16,
    trailing_dst: [()],
}

let mut src = 0xCAFEu16;
let src = src.as_mut_bytes();
let zsty = ZSTy::try_mut_from_bytes_with_elems(src, 42).unwrap();
assert_eq!(zsty.trailing_dst.len(), 42);
Source

fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), TryCastError<&mut [u8], Self>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self with a DST length equal to count.

This method attempts to return a reference to the prefix of source interpreted as a Self with count trailing elements, and a reference to the remaining bytes. If the length of source is less than the size of Self with count elements, if source is not appropriately aligned, or if the prefix of source does not contain a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

let bytes = &mut [0xC0, 0xC0, 240, 77, 2, 3, 4, 5, 6, 7, 8][..];

let (packet, suffix) = Packet::try_mut_from_prefix_with_elems(bytes, 3).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[2, 3], [4, 5], [6, 7]]);
assert_eq!(suffix, &[8u8][..]);

packet.temperature = 111;
suffix[0] = 222;

assert_eq!(bytes, [0xC0, 0xC0, 240, 111, 2, 3, 4, 5, 6, 7, 222]);

// These bytes are not valid instance of `Packet`.
let bytes = &mut [0, 1, 2, 3, 4, 5, 6, 7, 8, 77, 240, 0xC0, 0xC0][..];
assert!(Packet::try_mut_from_prefix_with_elems(bytes, 3).is_err());

Since an explicit count is provided, this method supports types with zero-sized trailing slice elements. Methods such as try_mut_from_prefix which do not take an explicit count do not support such types.

use core::num::NonZeroU16;
use zerocopy::*;

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct ZSTy {
    leading_sized: NonZeroU16,
    trailing_dst: [()],
}

let mut src = 0xCAFEu16;
let src = src.as_mut_bytes();
let (zsty, _) = ZSTy::try_mut_from_prefix_with_elems(src, 42).unwrap();
assert_eq!(zsty.trailing_dst.len(), 42);
Source

fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), TryCastError<&mut [u8], Self>>
where Self: KnownLayout<PointerMetadata = usize> + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self with a DST length equal to count.

This method attempts to return a reference to the suffix of source interpreted as a Self with count trailing elements, and a reference to the preceding bytes. If the length of source is less than the size of Self with count elements, if the suffix of source is not appropriately aligned, or if the suffix of source does not contain a valid instance of Self, this returns Err. If Self: Unaligned, you can infallibly discard the alignment error.

§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
    marshmallows: [[u8; 2]],
}

let bytes = &mut [123, 0xC0, 0xC0, 240, 77, 2, 3, 4, 5, 6, 7][..];

let (prefix, packet) = Packet::try_mut_from_suffix_with_elems(bytes, 3).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(packet.marshmallows, [[2, 3], [4, 5], [6, 7]]);
assert_eq!(prefix, &[123u8][..]);

prefix[0] = 111;
packet.temperature = 222;

assert_eq!(bytes, [111, 0xC0, 0xC0, 240, 222, 2, 3, 4, 5, 6, 7]);

// These bytes are not valid instance of `Packet`.
let bytes = &mut [0, 1, 2, 3, 4, 5, 6, 7, 8, 77, 240, 0xC0, 0xC0][..];
assert!(Packet::try_mut_from_suffix_with_elems(bytes, 3).is_err());

Since an explicit count is provided, this method supports types with zero-sized trailing slice elements. Methods such as try_mut_from_prefix which do not take an explicit count do not support such types.

use core::num::NonZeroU16;
use zerocopy::*;

#[derive(TryFromBytes, IntoBytes, KnownLayout)]
#[repr(C, packed)]
struct ZSTy {
    leading_sized: NonZeroU16,
    trailing_dst: [()],
}

let mut src = 0xCAFEu16;
let src = src.as_mut_bytes();
let (_, zsty) = ZSTy::try_mut_from_suffix_with_elems(src, 42).unwrap();
assert_eq!(zsty.trailing_dst.len(), 42);
Source

fn try_read_from_bytes(source: &[u8]) -> Result<Self, TryReadError<&[u8], Self>>
where Self: Sized,

Attempts to read the given source as a Self.

If source.len() != size_of::<Self>() or the bytes are not a valid instance of Self, this returns Err.

§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes)]
#[repr(C)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
}

let bytes = &[0xC0, 0xC0, 240, 77][..];

let packet = Packet::try_read_from_bytes(bytes).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);

// These bytes are not valid instance of `Packet`.
let bytes = &mut [0x10, 0xC0, 240, 77][..];
assert!(Packet::try_read_from_bytes(bytes).is_err());
Source

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), TryReadError<&[u8], Self>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source.

This attempts to read a Self from the first size_of::<Self>() bytes of source, returning that Self and any remaining bytes. If source.len() < size_of::<Self>() or the bytes are not a valid instance of Self, it returns Err.

§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes)]
#[repr(C)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
}

// These are more bytes than are needed to encode a `Packet`.
let bytes = &[0xC0, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5, 6][..];

let (packet, suffix) = Packet::try_read_from_prefix(bytes).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(suffix, &[0u8, 1, 2, 3, 4, 5, 6][..]);

// These bytes are not valid instance of `Packet`.
let bytes = &[0x10, 0xC0, 240, 77, 0, 1, 2, 3, 4, 5, 6][..];
assert!(Packet::try_read_from_prefix(bytes).is_err());
Source

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), TryReadError<&[u8], Self>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source.

This attempts to read a Self from the last size_of::<Self>() bytes of source, returning that Self and any preceding bytes. If source.len() < size_of::<Self>() or the bytes are not a valid instance of Self, it returns Err.

§Examples
use zerocopy::TryFromBytes;

// The only valid value of this type is the byte `0xC0`
#[derive(TryFromBytes)]
#[repr(u8)]
enum C0 { xC0 = 0xC0 }

// The only valid value of this type is the bytes `0xC0C0`.
#[derive(TryFromBytes)]
#[repr(C)]
struct C0C0(C0, C0);

#[derive(TryFromBytes)]
#[repr(C)]
struct Packet {
    magic_number: C0C0,
    mug_size: u8,
    temperature: u8,
}

// These are more bytes than are needed to encode a `Packet`.
let bytes = &[0, 1, 2, 3, 4, 5, 0xC0, 0xC0, 240, 77][..];

let (prefix, packet) = Packet::try_read_from_suffix(bytes).unwrap();

assert_eq!(packet.mug_size, 240);
assert_eq!(packet.temperature, 77);
assert_eq!(prefix, &[0u8, 1, 2, 3, 4, 5][..]);

// These bytes are not valid instance of `Packet`.
let bytes = &[0, 1, 2, 3, 4, 5, 0x10, 0xC0, 240, 77][..];
assert!(Packet::try_read_from_suffix(bytes).is_err());

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.

Implementations on Foreign Types§

Source§

impl TryFromBytes for Option<NonZeroI8>

Source§

impl TryFromBytes for Option<NonZeroI16>

Source§

impl TryFromBytes for Option<NonZeroI32>

Source§

impl TryFromBytes for Option<NonZeroI64>

Source§

impl TryFromBytes for Option<NonZeroI128>

Source§

impl TryFromBytes for Option<NonZeroIsize>

Source§

impl TryFromBytes for Option<NonZeroU8>

Source§

impl TryFromBytes for Option<NonZeroU16>

Source§

impl TryFromBytes for Option<NonZeroU32>

Source§

impl TryFromBytes for Option<NonZeroU64>

Source§

impl TryFromBytes for Option<NonZeroU128>

Source§

impl TryFromBytes for Option<NonZeroUsize>

Source§

impl TryFromBytes for bool

Source§

impl TryFromBytes for char

Source§

impl TryFromBytes for f32

Source§

impl TryFromBytes for f64

Source§

impl TryFromBytes for i8

Source§

impl TryFromBytes for i16

Source§

impl TryFromBytes for i32

Source§

impl TryFromBytes for i64

Source§

impl TryFromBytes for i128

Source§

impl TryFromBytes for isize

Source§

impl TryFromBytes for str

Source§

impl TryFromBytes for u8

Source§

impl TryFromBytes for u16

Source§

impl TryFromBytes for u32

Source§

impl TryFromBytes for u64

Source§

impl TryFromBytes for u128

Source§

impl TryFromBytes for ()

Source§

impl TryFromBytes for usize

Source§

impl TryFromBytes for __m128

Source§

impl TryFromBytes for __m128d

Source§

impl TryFromBytes for __m128i

Source§

impl TryFromBytes for __m256

Source§

impl TryFromBytes for __m256d

Source§

impl TryFromBytes for __m256i

Source§

impl TryFromBytes for AtomicBool

Source§

impl TryFromBytes for AtomicI8

Source§

impl TryFromBytes for AtomicI16

Source§

impl TryFromBytes for AtomicI32

Source§

impl TryFromBytes for AtomicI64

Source§

impl TryFromBytes for AtomicIsize

Source§

impl TryFromBytes for AtomicU8

Source§

impl TryFromBytes for AtomicU16

Source§

impl TryFromBytes for AtomicU32

Source§

impl TryFromBytes for AtomicU64

Source§

impl TryFromBytes for AtomicUsize

Source§

impl TryFromBytes for NonZeroI8

Source§

impl TryFromBytes for NonZeroI16

Source§

impl TryFromBytes for NonZeroI32

Source§

impl TryFromBytes for NonZeroI64

Source§

impl TryFromBytes for NonZeroI128

Source§

impl TryFromBytes for NonZeroIsize

Source§

impl TryFromBytes for NonZeroU8

Source§

impl TryFromBytes for NonZeroU16

Source§

impl TryFromBytes for NonZeroU32

Source§

impl TryFromBytes for NonZeroU64

Source§

impl TryFromBytes for NonZeroU128

Source§

impl TryFromBytes for NonZeroUsize

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<fn(B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern "C" fn(B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<fn(C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern "C" fn(C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<fn(D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern "C" fn(D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<E, F, G, H, I, J, K, L, M> TryFromBytes for Option<fn(E, F, G, H, I, J, K, L) -> M>

Source§

impl<E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern "C" fn(E, F, G, H, I, J, K, L) -> M>

Source§

impl<F, G, H, I, J, K, L, M> TryFromBytes for Option<fn(F, G, H, I, J, K, L) -> M>

Source§

impl<F, G, H, I, J, K, L, M> TryFromBytes for Option<extern "C" fn(F, G, H, I, J, K, L) -> M>

Source§

impl<G, H, I, J, K, L, M> TryFromBytes for Option<fn(G, H, I, J, K, L) -> M>

Source§

impl<G, H, I, J, K, L, M> TryFromBytes for Option<extern "C" fn(G, H, I, J, K, L) -> M>

Source§

impl<H, I, J, K, L, M> TryFromBytes for Option<fn(H, I, J, K, L) -> M>

Source§

impl<H, I, J, K, L, M> TryFromBytes for Option<extern "C" fn(H, I, J, K, L) -> M>

Source§

impl<I, J, K, L, M> TryFromBytes for Option<fn(I, J, K, L) -> M>

Source§

impl<I, J, K, L, M> TryFromBytes for Option<extern "C" fn(I, J, K, L) -> M>

Source§

impl<J, K, L, M> TryFromBytes for Option<fn(J, K, L) -> M>

Source§

impl<J, K, L, M> TryFromBytes for Option<extern "C" fn(J, K, L) -> M>

Source§

impl<K, L, M> TryFromBytes for Option<fn(K, L) -> M>

Source§

impl<K, L, M> TryFromBytes for Option<extern "C" fn(K, L) -> M>

Source§

impl<L, M> TryFromBytes for Option<fn(L) -> M>

Source§

impl<L, M> TryFromBytes for Option<extern "C" fn(L) -> M>

Source§

impl<M> TryFromBytes for Option<fn() -> M>

Source§

impl<M> TryFromBytes for Option<extern "C" fn() -> M>

Source§

impl<T> TryFromBytes for Option<&T>

Source§

impl<T> TryFromBytes for Option<&mut T>

Source§

impl<T> TryFromBytes for Option<NonNull<T>>

Source§

impl<T> TryFromBytes for *const T

Source§

impl<T> TryFromBytes for *mut T

Source§

impl<T> TryFromBytes for AtomicPtr<T>

Source§

impl<T> TryFromBytes for CoreMaybeUninit<T>

Source§

impl<T: TryFromBytes + ?Sized> TryFromBytes for UnsafeCell<T>

Source§

impl<T: TryFromBytes> TryFromBytes for [T]

Source§

impl<T: TryFromBytes> TryFromBytes for Wrapping<T>

Source§

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

Source§

impl<T: ?Sized + TryFromBytes> TryFromBytes for Cell<T>

Source§

impl<T: ?Sized + TryFromBytes> TryFromBytes for ManuallyDrop<T>

Source§

impl<T: ?Sized> TryFromBytes for PhantomData<T>

Implementors§

Source§

impl<O> TryFromBytes for F32<O>

Source§

impl<O> TryFromBytes for F64<O>

Source§

impl<O> TryFromBytes for I16<O>

Source§

impl<O> TryFromBytes for I32<O>

Source§

impl<O> TryFromBytes for I64<O>

Source§

impl<O> TryFromBytes for I128<O>

Source§

impl<O> TryFromBytes for Isize<O>

Source§

impl<O> TryFromBytes for U16<O>

Source§

impl<O> TryFromBytes for U32<O>

Source§

impl<O> TryFromBytes for U64<O>

Source§

impl<O> TryFromBytes for U128<O>

Source§

impl<O> TryFromBytes for Usize<O>

Source§

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

impl TryFromBytes for ZXName
where [u8; 32]: TryFromBytes,

impl TryFromBytes for BlockFifoCommand
where u8: TryFromBytes, [u8; 3]: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for BlockFifoRequest
where block_fifo_command_t: TryFromBytes, reqid_t: TryFromBytes, groupid_t: TryFromBytes, vmoid_t: TryFromBytes, u32: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for BlockFifoResponse
where zx_status_t: TryFromBytes, reqid_t: TryFromBytes, groupid_t: TryFromBytes, u16: TryFromBytes, u32: TryFromBytes, [u64; 4]: TryFromBytes,

impl TryFromBytes for Header
where u64: TryFromBytes,

impl TryFromBytes for EapolFields
where ProtocolVersion: TryFromBytes, PacketType: TryFromBytes, BigEndianU16: TryFromBytes,

impl TryFromBytes for KeyDescriptor
where u8: TryFromBytes,

impl TryFromBytes for KeyFrameFields
where KeyDescriptor: TryFromBytes, BigEndianU16: TryFromBytes, BigEndianU64: TryFromBytes, [u8; 32]: TryFromBytes, [u8; 16]: TryFromBytes, [u8; 8]: TryFromBytes,

impl TryFromBytes for KeyInformation
where u16: TryFromBytes,

impl TryFromBytes for PacketType
where u8: TryFromBytes,

impl TryFromBytes for ProtocolVersion
where u8: TryFromBytes,

impl TryFromBytes for BlockGroupDesc32
where U32: TryFromBytes, U16: TryFromBytes,

impl TryFromBytes for DirEntryHeader
where U32: TryFromBytes, U16: TryFromBytes, u8: TryFromBytes,

impl TryFromBytes for Extent
where U32: TryFromBytes, U16: TryFromBytes,

impl TryFromBytes for ExtentHeader
where U16: TryFromBytes, U32: TryFromBytes,

impl TryFromBytes for ExtentIndex
where U32: TryFromBytes, U16: TryFromBytes,

impl TryFromBytes for INode
where U16: TryFromBytes, U32: TryFromBytes, [u8; 4]: TryFromBytes, [u8; 60]: TryFromBytes,

impl TryFromBytes for SuperBlock
where U32: TryFromBytes, U16: TryFromBytes, [u8; 16]: TryFromBytes, [u8; 64]: TryFromBytes, u8: TryFromBytes, [U32; 4]: TryFromBytes, [U32; 17]: TryFromBytes, U64: TryFromBytes, [u8; 32]: TryFromBytes, [U32; 2]: TryFromBytes, [u8; 4]: TryFromBytes, [U32; 98]: TryFromBytes,

impl TryFromBytes for XattrEntryHeader
where u8: TryFromBytes, U16: TryFromBytes, U32: TryFromBytes,

impl TryFromBytes for XattrHeader
where U32: TryFromBytes, [u8; 8]: TryFromBytes,

impl<B> TryFromBytes for ExtentTreeNode<B>
where Ref<B, ExtentHeader>: TryFromBytes, B: TryFromBytes + SplitByteSlice,

impl TryFromBytes for BoardInfo
where u32: TryFromBytes,

impl TryFromBytes for DcfgAmlogicHdcpDriver
where u64: TryFromBytes,

impl TryFromBytes for DcfgAmlogicRngDriver
where u64: TryFromBytes,

impl TryFromBytes for DcfgArmGenericTimerDriver
where u32: TryFromBytes,

impl TryFromBytes for DcfgArmGicV2Driver
where u64: TryFromBytes, u32: TryFromBytes, u8: TryFromBytes, u16: TryFromBytes,

impl TryFromBytes for DcfgArmGicV3Driver
where u64: TryFromBytes, u32: TryFromBytes, u8: TryFromBytes, [u8; 3]: TryFromBytes,

impl TryFromBytes for DcfgArmPsciDriver
where u8: TryFromBytes, [u8; 7]: TryFromBytes, [u64; 3]: TryFromBytes,

impl TryFromBytes for DcfgGeneric32Watchdog
where DcfgGeneric32WatchdogAction: TryFromBytes, i64: TryFromBytes, KernelDriverGeneric32WatchdogFlags: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for DcfgGeneric32WatchdogAction
where u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for DcfgRiscvGenericTimerDriver
where u32: TryFromBytes,

impl TryFromBytes for DcfgRiscvPlicDriver
where u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for DcfgSimple
where u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for DcfgSimplePio
where u16: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for Flags
where u32: TryFromBytes,

impl TryFromBytes for Kernel
where u64: TryFromBytes,

impl TryFromBytes for KernelDriverGeneric32WatchdogFlags
where u32: TryFromBytes,

impl TryFromBytes for KernelDriverIrqFlags
where u32: TryFromBytes,

impl TryFromBytes for Nvram
where u64: TryFromBytes,

impl TryFromBytes for Partition
where PartitionGuid: TryFromBytes, u64: TryFromBytes, [u8; 32]: TryFromBytes,

impl TryFromBytes for PartitionMap
where u64: TryFromBytes, u32: TryFromBytes, PartitionGuid: TryFromBytes,

impl TryFromBytes for PlatformId
where u32: TryFromBytes, [u8; 32]: TryFromBytes,

impl TryFromBytes for TopologyArm64Info
where u8: TryFromBytes,

impl TryFromBytes for TopologyCache
where u32: TryFromBytes,

impl TryFromBytes for TopologyCluster
where u8: TryFromBytes,

impl TryFromBytes for TopologyDie
where u64: TryFromBytes,

impl TryFromBytes for TopologyNumaRegion
where u64: TryFromBytes,

impl TryFromBytes for TopologyProcessorFlags
where u16: TryFromBytes,

impl TryFromBytes for TopologyRiscv64Info
where u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for TopologySocket
where u64: TryFromBytes,

impl TryFromBytes for TopologyX64Info
where [u32; 4]: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for WireF32
where f32: TryFromBytes,

impl TryFromBytes for WireF64
where f64: TryFromBytes,

impl TryFromBytes for WireI16
where i16: TryFromBytes,

impl TryFromBytes for WireI32
where i32: TryFromBytes,

impl TryFromBytes for WireI64
where i64: TryFromBytes,

impl TryFromBytes for WireU16
where u16: TryFromBytes,

impl TryFromBytes for WireU32
where u32: TryFromBytes,

impl TryFromBytes for WireU64
where u64: TryFromBytes,

impl TryFromBytes for zbi_bootfs_dirent_t
where U32: TryFromBytes,

impl TryFromBytes for zbi_bootfs_header_t
where U32: TryFromBytes,

impl TryFromBytes for ZbiTopologyArm64Info
where u8: TryFromBytes,

impl TryFromBytes for ZbiTopologyCache
where u32: TryFromBytes,

impl TryFromBytes for ZbiTopologyCluster
where u8: TryFromBytes,

impl TryFromBytes for ZbiTopologyNode
where u8: TryFromBytes, u16: TryFromBytes, Entity: TryFromBytes,

impl TryFromBytes for ZbiTopologyNumaRegion
where u64: TryFromBytes,

impl TryFromBytes for ZbiTopologyProcessor
where [u16; 4]: TryFromBytes, u8: TryFromBytes, u16: TryFromBytes, ArchitectureInfo: TryFromBytes,

impl TryFromBytes for ZbiTopologyX64Info
where [u32; 4]: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for zbi_header_t
where U32: TryFromBytes,

impl TryFromBytes for ArchitectureInfo
where ZbiTopologyArm64Info: TryFromBytes + Immutable, ZbiTopologyX64Info: TryFromBytes + Immutable,

impl TryFromBytes for Entity
where ZbiTopologyProcessor: TryFromBytes + Immutable, ZbiTopologyCluster: TryFromBytes + Immutable, ZbiTopologyNumaRegion: TryFromBytes + Immutable, ZbiTopologyCache: TryFromBytes + Immutable,

impl TryFromBytes for ProxyFilename
where u64: TryFromBytes, [u8; 149]: TryFromBytes, [u8; 32]: TryFromBytes,

impl TryFromBytes for Header
where [u8; 8]: TryFromBytes, u32: TryFromBytes, u64: TryFromBytes, [u8; 16]: TryFromBytes,

impl TryFromBytes for PartitionTableEntry
where [u8; 16]: TryFromBytes, u64: TryFromBytes, [u16; 36]: TryFromBytes,

impl TryFromBytes for Bssid
where [u8; 6]: TryFromBytes,

impl TryFromBytes for MacAddr
where [u8; 6]: TryFromBytes,

impl TryFromBytes for Type00Config
where u16: TryFromBytes, u8: TryFromBytes, [u32; 6]: TryFromBytes, u32: TryFromBytes, [u8; 3]: TryFromBytes, [u8; 4]: TryFromBytes,

impl TryFromBytes for Type01Config
where u16: TryFromBytes, u8: TryFromBytes, [u32; 2]: TryFromBytes, u32: TryFromBytes, [u8; 3]: TryFromBytes,

impl TryFromBytes for magma_buffer_info
where u64: TryFromBytes,

impl TryFromBytes for magma_buffer_offset
where u64: TryFromBytes,

impl TryFromBytes for magma_exec_command_buffer
where u32: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for magma_exec_resource
where magma_buffer_id_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for magma_image_create_info
where u64: TryFromBytes, [u64; 16]: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for magma_image_info
where [u64; 4]: TryFromBytes, [u32; 4]: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for magma_total_time_query_result
where u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_clean_cache_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_clean_cache_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_export_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_export_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_get_cache_policy_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_get_cache_policy_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_get_handle_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_get_handle_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_get_info_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_get_info_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_set_cache_policy_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_set_cache_policy_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_set_name_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_buffer_set_name_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_config
where u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_clear_performance_counters_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_clear_performance_counters_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_create_buffer_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_create_buffer_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_create_context_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_create_context_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_create_semaphore_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_create_semaphore_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_dump_performance_counters_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_dump_performance_counters_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_enable_performance_counter_access_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_enable_performance_counter_access_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_enable_performance_counters_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_enable_performance_counters_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_execute_command_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_execute_command_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_execute_immediate_commands_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_execute_immediate_commands_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_execute_inline_commands_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_execute_inline_commands_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_flush_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_flush_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_get_error_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_get_error_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_get_notification_channel_handle_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_get_notification_channel_handle_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_import_buffer_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_import_buffer_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_import_semaphore2_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_import_semaphore2_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_map_buffer_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_map_buffer_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_perform_buffer_op_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_perform_buffer_op_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_read_notification_channel_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_read_notification_channel_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_release_buffer_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_release_context_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_release_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_release_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_release_semaphore_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_unmap_buffer_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_connection_unmap_buffer_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes,

impl TryFromBytes for virtio_magma_ctrl_hdr
where u32: TryFromBytes,

impl TryFromBytes for virtio_magma_device_create_connection_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_device_create_connection_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_device_import_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_device_import_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_device_query_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_device_query_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_device_release_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_device_release_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes,

impl TryFromBytes for virtio_magma_initialize_logging_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_initialize_logging_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_initialize_tracing_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_initialize_tracing_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_internal_map_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u32: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_internal_map_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_internal_release_handle_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_internal_release_handle_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_internal_unmap_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u32: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_internal_unmap_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_poll_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for virtio_magma_poll_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_semaphore_export_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_semaphore_export_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_semaphore_reset_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_semaphore_reset_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes,

impl TryFromBytes for virtio_magma_semaphore_signal_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_semaphore_signal_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes,

impl TryFromBytes for virtio_magma_virt_connection_create_image_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_virt_connection_create_image_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_virt_connection_get_image_info_ctrl
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtio_magma_virt_connection_get_image_info_resp
where virtio_magma_ctrl_hdr_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for virtmagma_buffer_set_name_wrapper
where __u64: TryFromBytes,

impl TryFromBytes for virtmagma_command_descriptor
where __u64: TryFromBytes,

impl TryFromBytes for virtmagma_create_image_wrapper
where __u64: TryFromBytes,

impl TryFromBytes for virtmagma_get_image_info_wrapper
where __u64: TryFromBytes,

impl TryFromBytes for virtmagma_ioctl_args_handshake
where __u32: TryFromBytes,

impl TryFromBytes for virtmagma_ioctl_args_magma_command
where __u64: TryFromBytes,

impl TryFromBytes for A
where [u8; 4]: TryFromBytes,

impl TryFromBytes for Aaaa
where [u8; 16]: TryFromBytes,

impl TryFromBytes for Header
where U16: TryFromBytes,

impl TryFromBytes for Mac
where [u8; 6]: TryFromBytes,

impl TryFromBytes for Ipv4Addr
where [u8; 4]: TryFromBytes,

impl TryFromBytes for Ipv6Addr
where [u8; 16]: TryFromBytes,

impl TryFromBytes for PacketHead
where U32: TryFromBytes,

impl TryFromBytes for Mldv1Message
where U16: TryFromBytes, Ipv6Addr: TryFromBytes,

impl TryFromBytes for Mldv2QueryMessageHeader
where U16: TryFromBytes, Ipv6Addr: TryFromBytes, u8: TryFromBytes,

impl TryFromBytes for Mldv2ReportHeader
where [u8; 2]: TryFromBytes, U16: TryFromBytes,

impl TryFromBytes for Mldv2ReportRecordHeader
where u8: TryFromBytes, U16: TryFromBytes, Ipv6Addr: TryFromBytes,

impl TryFromBytes for MulticastListenerDone

impl TryFromBytes for MulticastListenerQuery

impl TryFromBytes for MulticastListenerQueryV2

impl TryFromBytes for MulticastListenerReport

impl TryFromBytes for MulticastListenerReportV2

impl TryFromBytes for PrefixInformation
where u8: TryFromBytes, U32: TryFromBytes, [u8; 4]: TryFromBytes, Ipv6Addr: TryFromBytes,

impl TryFromBytes for NeighborAdvertisement
where u8: TryFromBytes, [u8; 3]: TryFromBytes, Ipv6Addr: TryFromBytes,

impl TryFromBytes for NeighborSolicitation
where [u8; 4]: TryFromBytes, Ipv6Addr: TryFromBytes,

impl TryFromBytes for Redirect
where [u8; 4]: TryFromBytes, Ipv6Addr: TryFromBytes,

impl TryFromBytes for RouterAdvertisement
where u8: TryFromBytes, U16: TryFromBytes, U32: TryFromBytes,

impl TryFromBytes for RouterSolicitation
where [u8; 4]: TryFromBytes,

impl TryFromBytes for IcmpDestUnreachable
where [u8; 2]: TryFromBytes, U16: TryFromBytes,

impl TryFromBytes for IcmpEchoReply
where IdAndSeq: TryFromBytes,

impl TryFromBytes for IcmpEchoRequest
where IdAndSeq: TryFromBytes,

impl TryFromBytes for IcmpTimeExceeded
where [u8; 4]: TryFromBytes,

impl TryFromBytes for Icmpv4ParameterProblem
where u8: TryFromBytes, [u8; 3]: TryFromBytes,

impl TryFromBytes for Icmpv4Redirect
where Ipv4Addr: TryFromBytes,

impl TryFromBytes for Icmpv4TimestampReply
where Timestamp: TryFromBytes,

impl TryFromBytes for Icmpv4TimestampRequest
where Timestamp: TryFromBytes,

impl TryFromBytes for Icmpv6PacketTooBig
where U32: TryFromBytes,

impl TryFromBytes for Icmpv6ParameterProblem
where U32: TryFromBytes,

impl TryFromBytes for GroupRecordHeader
where u8: TryFromBytes, U16: TryFromBytes, Ipv4Addr: TryFromBytes,

impl TryFromBytes for MembershipQueryData
where Ipv4Addr: TryFromBytes, u8: TryFromBytes, U16: TryFromBytes,

impl TryFromBytes for MembershipReportV3Data
where [u8; 2]: TryFromBytes, U16: TryFromBytes,

impl TryFromBytes for HeaderPrefix
where u8: TryFromBytes, [u8; 2]: TryFromBytes,

impl TryFromBytes for DscpAndEcn
where u8: TryFromBytes,

impl TryFromBytes for HeaderPrefix
where u8: TryFromBytes, DscpAndEcn: TryFromBytes, U16: TryFromBytes, [u8; 2]: TryFromBytes, Ipv4Addr: TryFromBytes,

impl TryFromBytes for FixedHeader
where [u8; 4]: TryFromBytes, U16: TryFromBytes, u8: TryFromBytes, Ipv6Addr: TryFromBytes,

impl TryFromBytes for TcpSackBlock
where U32: TryFromBytes,

impl TryFromBytes for TcpFlowAndSeqNum
where TcpFlowHeader: TryFromBytes, U32: TryFromBytes,

impl TryFromBytes for TcpFlowHeader
where U16: TryFromBytes,

impl TryFromBytes for Elf32Dyn
where u32: TryFromBytes,

impl TryFromBytes for Elf32FileHeader
where ElfIdent: TryFromBytes, u16: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for Elf32ProgramHeader
where u32: TryFromBytes,

impl TryFromBytes for Elf64Dyn
where u64: TryFromBytes,

impl TryFromBytes for Elf64FileHeader
where ElfIdent: TryFromBytes, u16: TryFromBytes, u32: TryFromBytes, usize: TryFromBytes,

impl TryFromBytes for Elf64ProgramHeader
where u32: TryFromBytes, usize: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for ElfIdent
where [u8; 4]: TryFromBytes, u8: TryFromBytes, [u8; 7]: TryFromBytes,

impl TryFromBytes for elf32_sym
where Elf32Word: TryFromBytes, Elf32Addr: TryFromBytes, u8: TryFromBytes, Elf32Half: TryFromBytes,

impl TryFromBytes for elf64_sym
where Elf64Word: TryFromBytes, u8: TryFromBytes, Elf64Half: TryFromBytes, Elf64Addr: TryFromBytes, Elf64Xword: TryFromBytes,

impl TryFromBytes for EUI48
where [u8; 6]: TryFromBytes,

impl TryFromBytes for EUI64
where [u8; 8]: TryFromBytes,

impl TryFromBytes for PacketType

impl TryFromBytes for Header
where [u8; 3]: TryFromBytes, PacketType: TryFromBytes, U32: TryFromBytes,

impl TryFromBytes for virtgralloc_set_vulkan_mode
where virtgralloc_VulkanMode: TryFromBytes, virtgralloc_SetVulkanModeResult: TryFromBytes,

impl TryFromBytes for BigEndianU128
where [u8; 16]: TryFromBytes,

impl TryFromBytes for BigEndianU16
where [u8; 2]: TryFromBytes,

impl TryFromBytes for BigEndianU32
where [u8; 4]: TryFromBytes,

impl TryFromBytes for BigEndianU64
where [u8; 8]: TryFromBytes,

impl TryFromBytes for AmpduParams
where u8: TryFromBytes,

impl TryFromBytes for ApWmmInfo
where u8: TryFromBytes,

impl TryFromBytes for AselCapability
where u8: TryFromBytes,

impl TryFromBytes for BitmapControl
where u8: TryFromBytes,

impl TryFromBytes for BssMaxIdlePeriod
where u16: TryFromBytes, IdleOptions: TryFromBytes,

impl TryFromBytes for ChannelSwitchAnnouncement
where u8: TryFromBytes,

impl TryFromBytes for ClientWmmInfo
where u8: TryFromBytes,

impl TryFromBytes for DsssParamSet
where u8: TryFromBytes,

impl TryFromBytes for EcwMinMax
where u8: TryFromBytes,

impl TryFromBytes for ExtCapabilitiesOctet1
where u8: TryFromBytes,

impl TryFromBytes for ExtCapabilitiesOctet2
where u8: TryFromBytes,

impl TryFromBytes for ExtCapabilitiesOctet3
where u8: TryFromBytes,

impl TryFromBytes for ExtendedChannelSwitchAnnouncement
where u8: TryFromBytes,

impl TryFromBytes for Header
where Id: TryFromBytes, u8: TryFromBytes,

impl TryFromBytes for HtCapabilities
where HtCapabilityInfo: TryFromBytes, AmpduParams: TryFromBytes, SupportedMcsSet: TryFromBytes, HtExtCapabilities: TryFromBytes, TxBfCapability: TryFromBytes, AselCapability: TryFromBytes,

impl TryFromBytes for HtCapabilityInfo
where u16: TryFromBytes,

impl TryFromBytes for HtExtCapabilities
where u16: TryFromBytes,

impl TryFromBytes for HtOpInfo
where [u8; 5]: TryFromBytes,

impl TryFromBytes for HtOperation
where u8: TryFromBytes, HtOpInfo: TryFromBytes, SupportedMcsSet: TryFromBytes,

impl TryFromBytes for Id
where u8: TryFromBytes,

impl TryFromBytes for IdleOptions
where u8: TryFromBytes,

impl TryFromBytes for MpmProtocol
where u16: TryFromBytes,

impl TryFromBytes for PerrDestinationFlags
where u8: TryFromBytes,

impl TryFromBytes for PerrDestinationHeader
where PerrDestinationFlags: TryFromBytes, MacAddr: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for PerrHeader
where u8: TryFromBytes,

impl TryFromBytes for PrepFlags
where u8: TryFromBytes,

impl TryFromBytes for PrepHeader
where PrepFlags: TryFromBytes, u8: TryFromBytes, MacAddr: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for PrepTail
where u32: TryFromBytes, MacAddr: TryFromBytes,

impl TryFromBytes for PreqFlags
where u8: TryFromBytes,

impl TryFromBytes for PreqHeader
where PreqFlags: TryFromBytes, u8: TryFromBytes, u32: TryFromBytes, MacAddr: TryFromBytes,

impl TryFromBytes for PreqMiddle
where u32: TryFromBytes, u8: TryFromBytes,

impl TryFromBytes for PreqPerTarget
where PreqPerTargetFlags: TryFromBytes, MacAddr: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for PreqPerTargetFlags
where u8: TryFromBytes,

impl TryFromBytes for RmEnabledCapabilities
where [u8; 5]: TryFromBytes,

impl TryFromBytes for SecChanOffset
where u8: TryFromBytes,

impl TryFromBytes for SupportedMcsSet
where u128: TryFromBytes,

impl TryFromBytes for SupportedRate
where u8: TryFromBytes,

impl TryFromBytes for TimHeader
where u8: TryFromBytes, BitmapControl: TryFromBytes,

impl TryFromBytes for TransmitPower
where u8: TryFromBytes,

impl TryFromBytes for TransmitPowerInfo
where u8: TryFromBytes,

impl TryFromBytes for TxBfCapability
where u32: TryFromBytes,

impl TryFromBytes for VhtCapabilities
where VhtCapabilitiesInfo: TryFromBytes, VhtMcsNssSet: TryFromBytes,

impl TryFromBytes for VhtCapabilitiesInfo
where u32: TryFromBytes,

impl TryFromBytes for VhtChannelBandwidth
where u8: TryFromBytes,

impl TryFromBytes for VhtMcsNssMap
where u16: TryFromBytes,

impl TryFromBytes for VhtMcsNssSet
where u64: TryFromBytes,

impl TryFromBytes for VhtOperation
where VhtChannelBandwidth: TryFromBytes, u8: TryFromBytes, VhtMcsNssMap: TryFromBytes,

impl TryFromBytes for WideBandwidthChannelSwitch
where VhtChannelBandwidth: TryFromBytes, u8: TryFromBytes,

impl TryFromBytes for WmmAcParams
where WmmAciAifsn: TryFromBytes, EcwMinMax: TryFromBytes, u16: TryFromBytes,

impl TryFromBytes for WmmAciAifsn
where u8: TryFromBytes,

impl TryFromBytes for WmmInfo
where u8: TryFromBytes,

impl TryFromBytes for WmmParam
where WmmInfo: TryFromBytes, u8: TryFromBytes, WmmAcParams: TryFromBytes,

impl TryFromBytes for AttributeHeader
where Id: TryFromBytes, BigEndianU16: TryFromBytes,

impl TryFromBytes for Id
where [u8; 2]: TryFromBytes,

impl TryFromBytes for WpsState
where u8: TryFromBytes,

impl TryFromBytes for ActionCategory
where u8: TryFromBytes,

impl TryFromBytes for ActionHdr
where ActionCategory: TryFromBytes,

impl TryFromBytes for AddbaReqHdr
where BlockAckAction: TryFromBytes, u8: TryFromBytes, BlockAckParameters: TryFromBytes, u16: TryFromBytes, BlockAckStartingSequenceControl: TryFromBytes,

impl TryFromBytes for AddbaRespHdr
where BlockAckAction: TryFromBytes, u8: TryFromBytes, StatusCode: TryFromBytes, BlockAckParameters: TryFromBytes, u16: TryFromBytes,

impl TryFromBytes for AmsduSubframeHdr
where MacAddr: TryFromBytes, BigEndianU16: TryFromBytes,

impl TryFromBytes for AssocReqHdr
where CapabilityInfo: TryFromBytes, u16: TryFromBytes,

impl TryFromBytes for AssocRespHdr
where CapabilityInfo: TryFromBytes, StatusCode: TryFromBytes, Aid: TryFromBytes,

impl TryFromBytes for AuthAlgorithmNumber
where u16: TryFromBytes,

impl TryFromBytes for AuthHdr
where AuthAlgorithmNumber: TryFromBytes, u16: TryFromBytes, StatusCode: TryFromBytes,

impl TryFromBytes for BeaconHdr
where u64: TryFromBytes, TimeUnit: TryFromBytes, CapabilityInfo: TryFromBytes,

impl TryFromBytes for BlockAckAction
where u8: TryFromBytes,

impl TryFromBytes for BlockAckParameters
where u16: TryFromBytes,

impl TryFromBytes for BlockAckPolicy
where u8: TryFromBytes,

impl TryFromBytes for BlockAckStartingSequenceControl
where u16: TryFromBytes,

impl TryFromBytes for CapabilityInfo
where u16: TryFromBytes,

impl TryFromBytes for DeauthHdr
where ReasonCode: TryFromBytes,

impl TryFromBytes for DelbaHdr
where BlockAckAction: TryFromBytes, DelbaParameters: TryFromBytes, ReasonCode: TryFromBytes,

impl TryFromBytes for DelbaParameters
where u16: TryFromBytes,

impl TryFromBytes for DisassocHdr
where ReasonCode: TryFromBytes,

impl TryFromBytes for EthernetIIHdr
where MacAddr: TryFromBytes, BigEndianU16: TryFromBytes,

impl TryFromBytes for FixedDataHdrFields
where FrameControl: TryFromBytes, u16: TryFromBytes, MacAddr: TryFromBytes, SequenceControl: TryFromBytes,

impl TryFromBytes for FrameControl
where u16: TryFromBytes,

impl TryFromBytes for HtControl
where u32: TryFromBytes,

impl TryFromBytes for LlcHdr
where u8: TryFromBytes, [u8; 3]: TryFromBytes, BigEndianU16: TryFromBytes,

impl TryFromBytes for MgmtHdr
where FrameControl: TryFromBytes, u16: TryFromBytes, MacAddr: TryFromBytes, SequenceControl: TryFromBytes,

impl TryFromBytes for ProbeRespHdr
where u64: TryFromBytes, TimeUnit: TryFromBytes, CapabilityInfo: TryFromBytes,

impl TryFromBytes for PsPoll
where u16: TryFromBytes, Bssid: TryFromBytes, MacAddr: TryFromBytes,

impl TryFromBytes for QosControl
where u16: TryFromBytes,

impl TryFromBytes for ReasonCode
where u16: TryFromBytes,

impl TryFromBytes for SequenceControl
where u16: TryFromBytes,

impl TryFromBytes for SpectrumMgmtAction
where u8: TryFromBytes,

impl TryFromBytes for StatusCode
where u16: TryFromBytes,

impl TryFromBytes for Oui
where [u8; 3]: TryFromBytes,

impl TryFromBytes for TimeUnit
where u16: TryFromBytes,

impl TryFromBytes for HandleCountInfo
where u32: TryFromBytes,

impl TryFromBytes for Koid
where zx_koid_t: TryFromBytes,

impl TryFromBytes for MapInfo
where Name: TryFromBytes, usize: TryFromBytes, zx_info_maps_type_t: TryFromBytes, InfoMapsTypeUnion: TryFromBytes,

impl TryFromBytes for MappingDetails
where VmarFlagsExtended: TryFromBytes, [PadByte; 4]: TryFromBytes, Koid: TryFromBytes, u64: TryFromBytes, usize: TryFromBytes,

impl TryFromBytes for MemStats
where u64: TryFromBytes,

impl TryFromBytes for MemStatsCompression
where u64: TryFromBytes, zx_duration_t: TryFromBytes, [u64; 8]: TryFromBytes,

impl TryFromBytes for MemStatsExtended
where u64: TryFromBytes,

impl TryFromBytes for MemoryStall
where zx_duration_mono_t: TryFromBytes,

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

impl TryFromBytes for PerCpuStats
where u32: TryFromBytes, zx_duration_t: TryFromBytes, u64: TryFromBytes,

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

impl TryFromBytes for ProcessInfo
where i64: TryFromBytes, zx_time_t: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for ResourceInfo
where u32: TryFromBytes, u64: TryFromBytes, usize: TryFromBytes, [u8; 32]: TryFromBytes,

impl TryFromBytes for Rights
where zx_rights_t: TryFromBytes,

impl TryFromBytes for TaskRuntimeInfo
where zx_duration_t: TryFromBytes,

impl TryFromBytes for TaskStatsInfo
where usize: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for VmarFlags
where zx_vm_option_t: TryFromBytes,

impl TryFromBytes for VmarFlagsExtended
where zx_vm_option_t: TryFromBytes,

impl TryFromBytes for VmarInfo
where usize: TryFromBytes,

impl TryFromBytes for VmoInfo
where Koid: TryFromBytes, Name: TryFromBytes, u64: TryFromBytes, usize: TryFromBytes, VmoInfoFlags: TryFromBytes, [PadByte; 4]: TryFromBytes, Rights: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for VmoInfoFlags
where u32: TryFromBytes,

impl<T, U> TryFromBytes for Duration<T, U>
where zx_duration_t: TryFromBytes, PhantomData<(T, U)>: TryFromBytes,

impl<T, U> TryFromBytes for Instant<T, U>
where zx_time_t: TryFromBytes, PhantomData<(T, U)>: TryFromBytes,

impl<T: Timeline> TryFromBytes for TimerInfo<T>
where u32: TryFromBytes, Instant<T>: TryFromBytes, Duration<T>: TryFromBytes,

impl TryFromBytes for PadByte
where u8: TryFromBytes,

impl TryFromBytes for priority_params
where i32: TryFromBytes, [PadByte; 20]: TryFromBytes,

impl TryFromBytes for zx_arm64_exc_data_t
where u32: TryFromBytes, [PadByte; 4]: TryFromBytes, u64: TryFromBytes, [PadByte; 8]: TryFromBytes,

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

impl TryFromBytes for zx_exception_context_t
where zx_exception_header_arch_t: TryFromBytes, zx_excp_policy_code_t: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for zx_exception_header_t
where u32: TryFromBytes, zx_excp_type_t: TryFromBytes,

impl TryFromBytes for zx_exception_info_t
where zx_koid_t: TryFromBytes, zx_excp_type_t: TryFromBytes, [PadByte; 4]: TryFromBytes,

impl TryFromBytes for zx_exception_report_t
where zx_exception_header_t: TryFromBytes, zx_exception_context_t: TryFromBytes,

impl TryFromBytes for zx_info_cpu_stats_t
where u32: TryFromBytes, zx_duration_t: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for zx_info_handle_basic_t
where zx_koid_t: TryFromBytes, zx_rights_t: TryFromBytes, zx_obj_type_t: TryFromBytes, [PadByte; 4]: TryFromBytes,

impl TryFromBytes for zx_info_handle_count_t
where u32: TryFromBytes,

impl TryFromBytes for zx_info_job_t
where i64: TryFromBytes, u8: TryFromBytes,

impl TryFromBytes for zx_info_kmem_stats_compression_t
where u64: TryFromBytes, zx_duration_t: TryFromBytes, [u64; 8]: TryFromBytes,

impl TryFromBytes for zx_info_kmem_stats_extended_t
where u64: TryFromBytes,

impl TryFromBytes for zx_info_kmem_stats_t
where u64: TryFromBytes,

impl TryFromBytes for zx_info_maps_mapping_t
where zx_vm_option_t: TryFromBytes, [PadByte; 4]: TryFromBytes, zx_koid_t: TryFromBytes, u64: TryFromBytes, usize: TryFromBytes,

impl TryFromBytes for zx_info_maps_t
where [u8; 32]: TryFromBytes, zx_vaddr_t: TryFromBytes, usize: TryFromBytes, zx_info_maps_type_t: TryFromBytes, InfoMapsTypeUnion: TryFromBytes,

impl TryFromBytes for zx_info_memory_stall_t
where zx_duration_mono_t: TryFromBytes,

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

impl TryFromBytes for zx_info_process_t
where i64: TryFromBytes, zx_time_t: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for zx_info_resource_t
where u32: TryFromBytes, u64: TryFromBytes, usize: TryFromBytes, [u8; 32]: TryFromBytes,

impl TryFromBytes for zx_info_socket_t
where u32: TryFromBytes, usize: TryFromBytes,

impl TryFromBytes for zx_info_task_runtime_t
where zx_duration_t: TryFromBytes,

impl TryFromBytes for zx_info_task_stats_t
where usize: TryFromBytes, u64: TryFromBytes,

impl TryFromBytes for zx_info_thread_stats_t
where zx_duration_t: TryFromBytes, u32: TryFromBytes,

impl TryFromBytes for zx_info_thread_t
where zx_thread_state_t: TryFromBytes, u32: TryFromBytes, zx_cpu_set_t: TryFromBytes,

impl TryFromBytes for zx_info_timer_t
where u32: TryFromBytes, zx_clock_t: TryFromBytes, zx_time_t: TryFromBytes, zx_duration_t: TryFromBytes,

impl TryFromBytes for zx_info_vmar_t
where usize: TryFromBytes,

impl TryFromBytes for zx_info_vmo_t
where zx_koid_t: TryFromBytes, [u8; 32]: TryFromBytes, u64: TryFromBytes, usize: TryFromBytes, u32: TryFromBytes, [PadByte; 4]: TryFromBytes, zx_rights_t: TryFromBytes,

impl TryFromBytes for zx_log_record_t
where u64: TryFromBytes, [PadByte; 4]: TryFromBytes, u16: TryFromBytes, u8: TryFromBytes, zx_instant_boot_t: TryFromBytes, [u8; 216]: TryFromBytes,

impl TryFromBytes for zx_packet_guest_vcpu_exit_t
where i64: TryFromBytes, [PadByte; 8]: TryFromBytes,

impl TryFromBytes for zx_packet_guest_vcpu_interrupt_t
where u64: TryFromBytes, u8: TryFromBytes, [PadByte; 7]: TryFromBytes,

impl TryFromBytes for zx_packet_guest_vcpu_startup_t
where u64: TryFromBytes, zx_gpaddr_t: TryFromBytes,

impl TryFromBytes for zx_riscv64_exc_data_t
where u64: TryFromBytes, [PadByte; 8]: TryFromBytes,

impl TryFromBytes for zx_sched_deadline_params_t
where zx_duration_t: TryFromBytes,

impl TryFromBytes for zx_thread_state_general_regs_t
where u64: TryFromBytes,

impl TryFromBytes for zx_x86_64_exc_data_t
where u64: TryFromBytes,

impl TryFromBytes for InfoMapsTypeUnion
where zx_info_maps_mapping_t: TryFromBytes + Immutable,

impl TryFromBytes for zx_exception_header_arch_t
where zx_x86_64_exc_data_t: TryFromBytes + Immutable, zx_arm64_exc_data_t: TryFromBytes + Immutable, zx_riscv64_exc_data_t: TryFromBytes + Immutable,

impl TryFromBytes for zx_packet_guest_vcpu_union_t
where zx_packet_guest_vcpu_interrupt_t: TryFromBytes + Immutable, zx_packet_guest_vcpu_startup_t: TryFromBytes + Immutable, zx_packet_guest_vcpu_exit_t: TryFromBytes + Immutable,

impl TryFromBytes for zx_profile_info_union
where priority_params: TryFromBytes + Immutable, zx_sched_deadline_params_t: TryFromBytes + Immutable,