Trait TryFromBytes
unsafe trait TryFromBytes
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.:
# use ;
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 documented 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
fn try_ref_from_bytes(source: &[u8]) -> Result<&Self, TryCastError<&[u8], Self>> where Self: KnownLayout + ImmutableAttempts to interpret the given
sourceas a&Self.If the bytes of
sourceare a valid instance ofSelf, this method returns a reference to those bytes interpreted as aSelf. If the length ofsourceis not a valid size ofSelf, or ifsourceis not appropriately aligned, or ifsourceis not a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Selfmay 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::*; # use zerocopy_derive::*; #[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 TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the byte sequence `0xC0C0`. ; let bytes = &; let packet = try_ref_from_bytes.unwrap; assert_eq!; assert_eq!; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &; assert!;fn try_ref_from_prefix(source: &[u8]) -> Result<(&Self, &[u8]), TryCastError<&[u8], Self>> where Self: KnownLayout + ImmutableAttempts to interpret the prefix of the given
sourceas a&Self.This method computes the largest possible size of
Selfthat can fit in the leading bytes ofsource. If that prefix is a valid instance ofSelf, this method returns a reference to those bytes interpreted asSelf, and a reference to the remaining bytes. If there are insufficient bytes, or ifsourceis not appropriately aligned, or if those bytes are not a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Selfmay 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::*; # use zerocopy_derive::*; #[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 TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; // These are more bytes than are needed to encode a `Packet`. let bytes = &; let = try_ref_from_prefix.unwrap; assert_eq!; assert_eq!; assert_eq!; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &; assert!;fn try_ref_from_suffix(source: &[u8]) -> Result<(&[u8], &Self), TryCastError<&[u8], Self>> where Self: KnownLayout + ImmutableAttempts to interpret the suffix of the given
sourceas a&Self.This method computes the largest possible size of
Selfthat can fit in the trailing bytes ofsource. If that suffix is a valid instance ofSelf, this method returns a reference to those bytes interpreted asSelf, and a reference to the preceding bytes. If there are insufficient bytes, or if the suffix ofsourcewould not be appropriately aligned, or if the suffix is not a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Selfmay 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::*; # use zerocopy_derive::*; #[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 TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; // These are more bytes than are needed to encode a `Packet`. let bytes = &; let = try_ref_from_suffix.unwrap; assert_eq!; assert_eq!; assert_eq!; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &; assert!;fn try_mut_from_bytes(bytes: &mut [u8]) -> Result<&mut Self, TryCastError<&mut [u8], Self>> where Self: KnownLayout + IntoBytesAttempts to interpret the given
sourceas a&mut Selfwithout copying.If the bytes of
sourceare a valid instance ofSelf, this method returns a reference to those bytes interpreted as aSelf. If the length ofsourceis not a valid size ofSelf, or ifsourceis not appropriately aligned, or ifsourceis not a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Selfmay 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::*; # use zerocopy_derive::*; #[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 TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; let bytes = &mut ; let packet = try_mut_from_bytes.unwrap; assert_eq!; assert_eq!; assert_eq!; packet.temperature = 111; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &mut ; assert!;fn try_mut_from_prefix(source: &mut [u8]) -> Result<(&mut Self, &mut [u8]), TryCastError<&mut [u8], Self>> where Self: KnownLayout + IntoBytesAttempts to interpret the prefix of the given
sourceas a&mut Self.This method computes the largest possible size of
Selfthat can fit in the leading bytes ofsource. If that prefix is a valid instance ofSelf, this method returns a reference to those bytes interpreted asSelf, and a reference to the remaining bytes. If there are insufficient bytes, or ifsourceis not appropriately aligned, or if the bytes are not a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Selfmay 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::*; # use zerocopy_derive::*; #[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 TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; // These are more bytes than are needed to encode a `Packet`. let bytes = &mut ; let = try_mut_from_prefix.unwrap; assert_eq!; assert_eq!; assert_eq!; assert_eq!; packet.temperature = 111; suffix = 222; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &mut ; assert!;fn try_mut_from_suffix(source: &mut [u8]) -> Result<(&mut [u8], &mut Self), TryCastError<&mut [u8], Self>> where Self: KnownLayout + IntoBytesAttempts to interpret the suffix of the given
sourceas a&mut Self.This method computes the largest possible size of
Selfthat can fit in the trailing bytes ofsource. If that suffix is a valid instance ofSelf, this method returns a reference to those bytes interpreted asSelf, and a reference to the preceding bytes. If there are insufficient bytes, or if the suffix ofsourcewould not be appropriately aligned, or if the suffix is not a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Selfmay 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::*; # use zerocopy_derive::*; #[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 TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; // These are more bytes than are needed to encode a `Packet`. let bytes = &mut ; let = try_mut_from_suffix.unwrap; assert_eq!; assert_eq!; assert_eq!; assert_eq!; prefix = 111; packet.temperature = 222; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &mut ; assert!;fn try_ref_from_bytes_with_elems(source: &[u8], count: usize) -> Result<&Self, TryCastError<&[u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + ImmutableAttempts to interpret the given
sourceas a&Selfwith a DST length equal tocount.This method attempts to return a reference to
sourceinterpreted as aSelfwithcounttrailing elements. If the length ofsourceis not equal to the size ofSelfwithcountelements, ifsourceis not appropriately aligned, or ifsourcedoes not contain a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Examples
# // For C0::xC0 use TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; let bytes = &; let packet = try_ref_from_bytes_with_elems.unwrap; assert_eq!; assert_eq!; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &; assert!;Since an explicit
countis provided, this method supports types with zero-sized trailing slice elements. Methods such astry_ref_from_byteswhich do not take an explicit count do not support such types.use NonZeroU16; use *; # use *; let src = 0xCAFEu16.as_bytes; let zsty = try_ref_from_bytes_with_elems.unwrap; assert_eq!;fn try_ref_from_prefix_with_elems(source: &[u8], count: usize) -> Result<(&Self, &[u8]), TryCastError<&[u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + ImmutableAttempts to interpret the prefix of the given
sourceas a&Selfwith a DST length equal tocount.This method attempts to return a reference to the prefix of
sourceinterpreted as aSelfwithcounttrailing elements, and a reference to the remaining bytes. If the length ofsourceis less than the size ofSelfwithcountelements, ifsourceis not appropriately aligned, or if the prefix ofsourcedoes not contain a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Examples
# // For C0::xC0 use TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; let bytes = &; let = try_ref_from_prefix_with_elems.unwrap; assert_eq!; assert_eq!; assert_eq!; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &mut ; assert!;Since an explicit
countis provided, this method supports types with zero-sized trailing slice elements. Methods such astry_ref_from_prefixwhich do not take an explicit count do not support such types.use NonZeroU16; use *; # use *; let src = 0xCAFEu16.as_bytes; let = try_ref_from_prefix_with_elems.unwrap; assert_eq!;fn try_ref_from_suffix_with_elems(source: &[u8], count: usize) -> Result<(&[u8], &Self), TryCastError<&[u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + ImmutableAttempts to interpret the suffix of the given
sourceas a&Selfwith a DST length equal tocount.This method attempts to return a reference to the suffix of
sourceinterpreted as aSelfwithcounttrailing elements, and a reference to the preceding bytes. If the length ofsourceis less than the size ofSelfwithcountelements, if the suffix ofsourceis not appropriately aligned, or if the suffix ofsourcedoes not contain a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Examples
# // For C0::xC0 use TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; let bytes = &; let = try_ref_from_suffix_with_elems.unwrap; assert_eq!; assert_eq!; assert_eq!; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &; assert!;Since an explicit
countis provided, this method supports types with zero-sized trailing slice elements. Methods such astry_ref_from_prefixwhich do not take an explicit count do not support such types.use NonZeroU16; use *; # use *; let src = 0xCAFEu16.as_bytes; let = try_ref_from_suffix_with_elems.unwrap; assert_eq!;fn try_mut_from_bytes_with_elems(source: &mut [u8], count: usize) -> Result<&mut Self, TryCastError<&mut [u8], Self>> where Self: KnownLayout<PointerMetadata = usize> + IntoBytesAttempts to interpret the given
sourceas a&mut Selfwith a DST length equal tocount.This method attempts to return a reference to
sourceinterpreted as aSelfwithcounttrailing elements. If the length ofsourceis not equal to the size ofSelfwithcountelements, ifsourceis not appropriately aligned, or ifsourcedoes not contain a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Examples
# // For C0::xC0 use TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; let bytes = &mut ; let packet = try_mut_from_bytes_with_elems.unwrap; assert_eq!; assert_eq!; assert_eq!; packet.temperature = 111; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &mut ; assert!;Since an explicit
countis provided, this method supports types with zero-sized trailing slice elements. Methods such astry_mut_from_byteswhich do not take an explicit count do not support such types.use NonZeroU16; use *; # use *; let mut src = 0xCAFEu16; let src = src.as_mut_bytes; let zsty = try_mut_from_bytes_with_elems.unwrap; assert_eq!;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> + IntoBytesAttempts to interpret the prefix of the given
sourceas a&mut Selfwith a DST length equal tocount.This method attempts to return a reference to the prefix of
sourceinterpreted as aSelfwithcounttrailing elements, and a reference to the remaining bytes. If the length ofsourceis less than the size ofSelfwithcountelements, ifsourceis not appropriately aligned, or if the prefix ofsourcedoes not contain a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Examples
# // For C0::xC0 use TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; let bytes = &mut ; let = try_mut_from_prefix_with_elems.unwrap; assert_eq!; assert_eq!; assert_eq!; assert_eq!; packet.temperature = 111; suffix = 222; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &mut ; assert!;Since an explicit
countis provided, this method supports types with zero-sized trailing slice elements. Methods such astry_mut_from_prefixwhich do not take an explicit count do not support such types.use NonZeroU16; use *; # use *; let mut src = 0xCAFEu16; let src = src.as_mut_bytes; let = try_mut_from_prefix_with_elems.unwrap; assert_eq!;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> + IntoBytesAttempts to interpret the suffix of the given
sourceas a&mut Selfwith a DST length equal tocount.This method attempts to return a reference to the suffix of
sourceinterpreted as aSelfwithcounttrailing elements, and a reference to the preceding bytes. If the length ofsourceis less than the size ofSelfwithcountelements, if the suffix ofsourceis not appropriately aligned, or if the suffix ofsourcedoes not contain a valid instance ofSelf, this returnsErr. IfSelf: Unaligned, you can [infallibly discard the alignment error][ConvertError::from].Examples
# // For C0::xC0 use TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; let bytes = &mut ; let = try_mut_from_suffix_with_elems.unwrap; assert_eq!; assert_eq!; assert_eq!; assert_eq!; prefix = 111; packet.temperature = 222; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &mut ; assert!;Since an explicit
countis provided, this method supports types with zero-sized trailing slice elements. Methods such astry_mut_from_prefixwhich do not take an explicit count do not support such types.use NonZeroU16; use *; # use *; let mut src = 0xCAFEu16; let src = src.as_mut_bytes; let = try_mut_from_suffix_with_elems.unwrap; assert_eq!;fn try_read_from_bytes(source: &[u8]) -> Result<Self, TryReadError<&[u8], Self>> where Self: SizedAttempts to read the given
sourceas aSelf.If
source.len() != size_of::<Self>()or the bytes are not a valid instance ofSelf, this returnsErr.Examples
use TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; let bytes = &; let packet = try_read_from_bytes.unwrap; assert_eq!; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &mut ; assert!;fn try_read_from_prefix(source: &[u8]) -> Result<(Self, &[u8]), TryReadError<&[u8], Self>> where Self: SizedAttempts to read a
Selffrom the prefix of the givensource.This attempts to read a
Selffrom the firstsize_of::<Self>()bytes ofsource, returning thatSelfand any remaining bytes. Ifsource.len() < size_of::<Self>()or the bytes are not a valid instance ofSelf, it returnsErr.Examples
use TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; // These are more bytes than are needed to encode a `Packet`. let bytes = &; let = try_read_from_prefix.unwrap; assert_eq!; assert_eq!; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &; assert!;fn try_read_from_suffix(source: &[u8]) -> Result<(&[u8], Self), TryReadError<&[u8], Self>> where Self: SizedAttempts to read a
Selffrom the suffix of the givensource.This attempts to read a
Selffrom the lastsize_of::<Self>()bytes ofsource, returning thatSelfand any preceding bytes. Ifsource.len() < size_of::<Self>()or the bytes are not a valid instance ofSelf, it returnsErr.Examples
# // For C0::xC0 use TryFromBytes; # use *; // The only valid value of this type is the byte `0xC0` // The only valid value of this type is the bytes `0xC0C0`. ; // These are more bytes than are needed to encode a `Packet`. let bytes = &; let = try_read_from_suffix.unwrap; assert_eq!; assert_eq!; assert_eq!; // These bytes are not valid instance of `Packet`. let bytes = &; assert!;
Implementors
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>impl TryFromBytes for f32impl TryFromBytes for AtomicU64impl<J, K, L, M> TryFromBytes for Option<unsafe fn(_: J, _: K, _: L) -> M>impl TryFromBytes for NonZeroU8impl<T: ?Sized> TryFromBytes for PhantomData<T>impl<E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe fn(_: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for NonZeroI32impl<T: TryFromBytes + ?Sized> TryFromBytes for UnsafeCell<T>impl<M> TryFromBytes for Option<extern C { unwind: false } fn() -> M>impl TryFromBytes for NonZeroUsizeimpl TryFromBytes for __m128impl<H, I, J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroI16>impl TryFromBytes for __m256iimpl<C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroU128>impl<K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: K, _: L) -> M>impl<T> TryFromBytes for Option<&mut T>impl<O> TryFromBytes for U32<O>impl TryFromBytes for ()impl<F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl<J, K, L, M> TryFromBytes for Option<fn(_: J, _: K, _: L) -> M>impl<O> TryFromBytes for U128<O>impl TryFromBytes for u32impl<A, B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: A, _: B, _: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl<O> TryFromBytes for U16<O>impl<E, F, G, H, I, J, K, L, M> TryFromBytes for Option<fn(_: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for i128impl TryFromBytes for AtomicI16impl<M> TryFromBytes for Option<unsafe fn() -> M>impl TryFromBytes for boolimpl<O> TryFromBytes for F32<O>impl TryFromBytes for AtomicUsizeimpl<O> TryFromBytes for I64<O>impl<H, I, J, K, L, M> TryFromBytes for Option<unsafe fn(_: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for NonZeroU16impl<T> TryFromBytes for CoreMaybeUninit<T>impl<C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe fn(_: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for NonZeroI64impl<T: TryFromBytes> TryFromBytes for [T]impl<K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: K, _: L) -> M>impl TryFromBytes for Option<NonZeroU8>impl TryFromBytes for __m128iimpl<F, G, H, I, J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroI32>impl TryFromBytes for __m512impl<A, B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: A, _: B, _: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroUsize>impl<I, J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: I, _: J, _: K, _: L) -> M>impl<M> TryFromBytes for Option<fn() -> M>impl TryFromBytes for i8impl<D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl<H, I, J, K, L, M> TryFromBytes for Option<fn(_: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for u64impl TryFromBytes for AtomicI8impl<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>impl TryFromBytes for isizeimpl TryFromBytes for AtomicI32impl<K, L, M> TryFromBytes for Option<unsafe fn(_: K, _: L) -> M>impl TryFromBytes for strimpl<T> TryFromBytes for AtomicPtr<T>impl<F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe fn(_: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl<O> TryFromBytes for I16<O>impl TryFromBytes for NonZeroU32impl<T: ?Sized + TryFromBytes> TryFromBytes for Cell<T>impl<A, B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe fn(_: A, _: B, _: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for NonZeroI128impl<T> TryFromBytes for Unalign<T>impl<T> TryFromBytes for *mut Timpl<O> TryFromBytes for I32<O>impl<I, J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: I, _: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroU16>impl TryFromBytes for __m256dimpl<D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroI64>impl TryFromBytes for __m512iimpl<L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: L) -> M>impl<T> TryFromBytes for Option<&T>impl<G, H, I, J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: G, _: H, _: I, _: J, _: K, _: L) -> M>impl<K, L, M> TryFromBytes for Option<fn(_: K, _: L) -> M>impl TryFromBytes for i16impl<O> TryFromBytes for Isize<O>impl<B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: B, _: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl<F, G, H, I, J, K, L, M> TryFromBytes for Option<fn(_: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for u128impl TryFromBytes for AtomicU16impl<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>impl<O> TryFromBytes for Usize<O>impl TryFromBytes for f64impl TryFromBytes for AtomicI64impl<I, J, K, L, M> TryFromBytes for Option<unsafe fn(_: I, _: J, _: K, _: L) -> M>impl TryFromBytes for NonZeroI8impl<T: TryFromBytes> TryFromBytes for Wrapping<T>impl<D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe fn(_: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for NonZeroU64impl<T: TryFromBytes, N: usize> TryFromBytes for [T; N]impl<L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: L) -> M>impl<O> TryFromBytes for U64<O>impl TryFromBytes for NonZeroIsizeimpl TryFromBytes for __m128dimpl<G, H, I, J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroU32>impl TryFromBytes for __m512bhimpl<B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: B, _: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroI128>impl<J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: J, _: K, _: L) -> M>impl<T> TryFromBytes for Option<NonNull<T>>impl TryFromBytes for u8impl<E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl<I, J, K, L, M> TryFromBytes for Option<fn(_: I, _: J, _: K, _: L) -> M>impl TryFromBytes for i32impl TryFromBytes for AtomicU8impl<D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<fn(_: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for usizeimpl TryFromBytes for AtomicU32impl<L, M> TryFromBytes for Option<unsafe fn(_: L) -> M>impl TryFromBytes for charimpl TryFromBytes for AtomicIsizeimpl<G, H, I, J, K, L, M> TryFromBytes for Option<unsafe fn(_: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for NonZeroI16impl<T: ?Sized + TryFromBytes> TryFromBytes for ManuallyDrop<T>impl<B, C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe fn(_: B, _: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for NonZeroU128impl<T> TryFromBytes for *const Timpl<J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroI8>impl<O> TryFromBytes for F64<O>impl TryFromBytes for __m256impl<E, F, G, H, I, J, K, L, M> TryFromBytes for Option<extern C { unwind: false } fn(_: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for Option<NonZeroU64>impl TryFromBytes for __m512dimpl<O> TryFromBytes for I128<O>impl<M> TryFromBytes for Option<unsafe extern C { unwind: false } fn() -> M>impl TryFromBytes for Option<NonZeroIsize>impl<H, I, J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: H, _: I, _: J, _: K, _: L) -> M>impl<L, M> TryFromBytes for Option<fn(_: L) -> M>impl TryFromBytes for u16impl<C, D, E, F, G, H, I, J, K, L, M> TryFromBytes for Option<unsafe extern C { unwind: false } fn(_: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L) -> M>impl<G, H, I, J, K, L, M> TryFromBytes for Option<fn(_: G, _: H, _: I, _: J, _: K, _: L) -> M>impl TryFromBytes for i64impl TryFromBytes for AtomicBool