Trait FromZeros
pub unsafe trait FromZeros: TryFromBytes
Types for which a sequence of 0 bytes is a valid instance.
Any memory region of the appropriate length which is guaranteed to contain
only zero bytes can be viewed as any FromZeros type with no runtime
overhead. This is useful whenever memory is known to be in a zeroed state,
such memory returned from some allocation routines.
Warning: Padding bytes
Note that, when a value is moved or copied, only the non-padding bytes of
that value are guaranteed to be preserved. It is unsound to assume that
values written to padding bytes are preserved after a move or copy. For more
details, see the FromBytes docs.
Implementation
Do not implement this trait yourself! Instead, use
#[derive(FromZeros)]; e.g.:
# use ;
union MyUnion
This derive performs a sophisticated, compile-time safety analysis to
determine whether a type is FromZeros.
Safety
This section describes what is required in order for T: FromZeros, and
what unsafe code may assume of such types. If you don't plan on implementing
FromZeros manually, and you don't plan on writing unsafe code that
operates on FromZeros types, then you don't need to read this section.
If T: FromZeros, then unsafe code may assume that it is sound to produce a
T whose bytes are all initialized to zero. If a type is marked as
FromZeros which violates this contract, it may cause undefined behavior.
#[derive(FromZeros)] only permits types which satisfy these
requirements.
Provided Methods
fn zero(&mut self)Overwrites
selfwith zeros.Sets every byte in
selfto 0. While this is similar to doing*self = Self::new_zeroed(), it differs in thatzerodoes not semantically drop the current value and replace it with a new one — it simply modifies the bytes of the existing value.Examples
# use FromZeros; # use *; # let mut header = PacketHeader ; header.zero; assert_eq!; assert_eq!; assert_eq!; assert_eq!;§ Code Generation
This abstraction is safe and cheap, but does not necessarily have zero runtime cost. The codegen you experience in practice will depend on optimization level, the layout of the destination type, and what the compiler can prove about the source.
The below examples illustrate typical codegen for increasingly complex types:
Sized
Format
use zerocopy_derive::*; // The only valid value of this type are the bytes `0xC0C0`. #[derive(TryFromBytes, KnownLayout, Immutable, IntoBytes)] #[repr(u16)] pub enum C0C0 { _XC0C0 = 0xC0C0, } macro_rules! define_packet { ($name: ident, $trait: ident, $leading_field: ty) => { #[derive($trait, KnownLayout, Immutable, IntoBytes)] #[repr(C, align(2))] pub struct $name { magic_number: $leading_field, mug_size: u8, temperature: u8, marshmallows: [u8; 2], } }; } /// Packet begins with bytes 0xC0C0. define_packet!(CocoPacket, TryFromBytes, C0C0); /// Packet begins with any two bytes. define_packet!(LocoPacket, FromBytes, [u8; 2]);Benchmark
use zerocopy::*; #[path = "formats/coco_static_size.rs"] mod format; #[unsafe(no_mangle)] fn bench_zero_static_size(source: &mut format::LocoPacket) { source.zero() }Assembly
bench_zero_static_size: mov word ptr [rdi + 4], 0 mov dword ptr [rdi], 0 retMachine Code Analysis
Iterations: 100 Instructions: 300 Total Cycles: 203 Total uOps: 300 Dispatch Width: 4 uOps Per Cycle: 1.48 IPC: 1.48 Block RThroughput: 2.0 Instruction Info: [1]: #uOps [2]: Latency [3]: RThroughput [4]: MayLoad [5]: MayStore [6]: HasSideEffects (U) [1] [2] [3] [4] [5] [6] Instructions: 1 1 1.00 * mov word ptr [rdi + 4], 0 1 1 1.00 * mov dword ptr [rdi], 0 1 1 1.00 U ret Resources: [0] - SBDivider [1] - SBFPDivider [2] - SBPort0 [3] - SBPort1 [4] - SBPort4 [5] - SBPort5 [6.0] - SBPort23 [6.1] - SBPort23 Resource pressure per iteration: [0] [1] [2] [3] [4] [5] [6.0] [6.1] - - - - 2.00 1.00 1.00 1.00 Resource pressure by instruction: [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions: - - - - 1.00 - - 1.00 mov word ptr [rdi + 4], 0 - - - - 1.00 - 1.00 - mov dword ptr [rdi], 0 - - - - - 1.00 - - retUnsized
Format
use zerocopy_derive::*; // The only valid value of this type are the bytes `0xC0C0`. #[derive(TryFromBytes, KnownLayout, Immutable, IntoBytes)] #[repr(u16)] pub enum C0C0 { _XC0C0 = 0xC0C0, } macro_rules! define_packet { ($name: ident, $trait: ident, $leading_field: ty) => { #[derive($trait, KnownLayout, Immutable, IntoBytes, SplitAt)] #[repr(C, align(2))] pub struct $name { magic_number: $leading_field, mug_size: u8, temperature: u8, marshmallows: [[u8; 2]], } }; } /// Packet begins with bytes 0xC0C0. define_packet!(CocoPacket, TryFromBytes, C0C0); /// Packet begins with any two bytes. define_packet!(LocoPacket, FromBytes, [u8; 2]);Benchmark
use zerocopy::*; #[path = "formats/coco_dynamic_size.rs"] mod format; #[unsafe(no_mangle)] fn bench_zero_dynamic_size(source: &mut format::LocoPacket) { source.zero() }Assembly
bench_zero_dynamic_size: lea rdx, [2*rsi + 5] and rdx, -2 xor esi, esi jmp qword ptr [rip + memset@GOTPCREL]Machine Code Analysis
Iterations: 100 Instructions: 400 Total Cycles: 142 Total uOps: 500 Dispatch Width: 4 uOps Per Cycle: 3.52 IPC: 2.82 Block RThroughput: 1.3 Instruction Info: [1]: #uOps [2]: Latency [3]: RThroughput [4]: MayLoad [5]: MayStore [6]: HasSideEffects (U) [1] [2] [3] [4] [5] [6] Instructions: 1 1 0.50 lea rdx, [2*rsi + 5] 1 1 0.33 and rdx, -2 1 0 0.25 xor esi, esi 2 6 1.00 * jmp qword ptr [rip + memset@GOTPCREL] Resources: [0] - SBDivider [1] - SBFPDivider [2] - SBPort0 [3] - SBPort1 [4] - SBPort4 [5] - SBPort5 [6.0] - SBPort23 [6.1] - SBPort23 Resource pressure per iteration: [0] [1] [2] [3] [4] [5] [6.0] [6.1] - - 0.99 1.00 - 1.01 0.50 0.50 Resource pressure by instruction: [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions: - - 0.99 0.01 - - - - lea rdx, [2*rsi + 5] - - - 0.99 - 0.01 - - and rdx, -2 - - - - - - - - xor esi, esi - - - - - 1.00 0.50 0.50 jmp qword ptr [rip + memset@GOTPCREL]Dynamically Padded
Format
use zerocopy_derive::*; // The only valid value of this type are the bytes `0xC0C0`. #[derive(TryFromBytes, KnownLayout, Immutable)] #[repr(u16)] pub enum C0C0 { _XC0C0 = 0xC0C0, } #[derive(FromBytes, KnownLayout, Immutable, SplitAt)] #[repr(C, align(4))] pub struct Packet<Magic> { magic_number: Magic, milk: u8, mug_size: u8, temperature: [u8; 5], marshmallows: [[u8; 3]], } /// A packet begining with the magic number `0xC0C0`. pub type CocoPacket = Packet<C0C0>; /// A packet beginning with any two initialized bytes. pub type LocoPacket = Packet<[u8; 2]>;Benchmark
use zerocopy::*; #[path = "formats/coco_dynamic_padding.rs"] mod format; #[unsafe(no_mangle)] fn bench_zero_dynamic_padding(source: &mut format::LocoPacket) { source.zero() }Assembly
bench_zero_dynamic_padding: lea rax, [rsi + 2*rsi] movabs rdx, 9223372036854775804 and rdx, rax add rdx, 12 xor esi, esi jmp qword ptr [rip + memset@GOTPCREL]Machine Code Analysis
Iterations: 100 Instructions: 600 Total Cycles: 209 Total uOps: 700 Dispatch Width: 4 uOps Per Cycle: 3.35 IPC: 2.87 Block RThroughput: 1.8 Instruction Info: [1]: #uOps [2]: Latency [3]: RThroughput [4]: MayLoad [5]: MayStore [6]: HasSideEffects (U) [1] [2] [3] [4] [5] [6] Instructions: 1 1 0.50 lea rax, [rsi + 2*rsi] 1 1 0.33 movabs rdx, 9223372036854775804 1 1 0.33 and rdx, rax 1 1 0.33 add rdx, 12 1 0 0.25 xor esi, esi 2 6 1.00 * jmp qword ptr [rip + memset@GOTPCREL] Resources: [0] - SBDivider [1] - SBFPDivider [2] - SBPort0 [3] - SBPort1 [4] - SBPort4 [5] - SBPort5 [6.0] - SBPort23 [6.1] - SBPort23 Resource pressure per iteration: [0] [1] [2] [3] [4] [5] [6.0] [6.1] - - 1.66 1.66 - 1.68 0.50 0.50 Resource pressure by instruction: [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions: - - 0.33 0.67 - - - - lea rax, [rsi + 2*rsi] - - 0.98 - - 0.02 - - movabs rdx, 9223372036854775804 - - 0.01 0.66 - 0.33 - - and rdx, rax - - 0.34 0.33 - 0.33 - - add rdx, 12 - - - - - - - - xor esi, esi - - - - - 1.00 0.50 0.50 jmp qword ptr [rip + memset@GOTPCREL]fn new_zeroed() -> Self where Self: Sized,Creates an instance of
Selffrom zeroed bytes.Examples
# use FromZeros; # use *; # let header: PacketHeader = new_zeroed; assert_eq!; assert_eq!; assert_eq!; assert_eq!;§ Code Generation
This abstraction is safe and cheap, but does not necessarily have zero runtime cost. The codegen you experience in practice will depend on optimization level, the layout of the destination type, and what the compiler can prove about the source.
Format
use zerocopy_derive::*; // The only valid value of this type are the bytes `0xC0C0`. #[derive(TryFromBytes, KnownLayout, Immutable, IntoBytes)] #[repr(u16)] pub enum C0C0 { _XC0C0 = 0xC0C0, } macro_rules! define_packet { ($name: ident, $trait: ident, $leading_field: ty) => { #[derive($trait, KnownLayout, Immutable, IntoBytes)] #[repr(C, align(2))] pub struct $name { magic_number: $leading_field, mug_size: u8, temperature: u8, marshmallows: [u8; 2], } }; } /// Packet begins with bytes 0xC0C0. define_packet!(CocoPacket, TryFromBytes, C0C0); /// Packet begins with any two bytes. define_packet!(LocoPacket, FromBytes, [u8; 2]);Benchmark
use zerocopy::*; #[path = "formats/coco_static_size.rs"] mod format; #[unsafe(no_mangle)] fn bench_new_zeroed() -> format::LocoPacket { FromZeros::new_zeroed() }Assembly
bench_new_zeroed: xor eax, eax retMachine Code Analysis
Iterations: 100 Instructions: 200 Total Cycles: 103 Total uOps: 200 Dispatch Width: 4 uOps Per Cycle: 1.94 IPC: 1.94 Block RThroughput: 1.0 Instruction Info: [1]: #uOps [2]: Latency [3]: RThroughput [4]: MayLoad [5]: MayStore [6]: HasSideEffects (U) [1] [2] [3] [4] [5] [6] Instructions: 1 0 0.25 xor eax, eax 1 1 1.00 U ret Resources: [0] - SBDivider [1] - SBFPDivider [2] - SBPort0 [3] - SBPort1 [4] - SBPort4 [5] - SBPort5 [6.0] - SBPort23 [6.1] - SBPort23 Resource pressure per iteration: [0] [1] [2] [3] [4] [5] [6.0] [6.1] - - - - - 1.00 - - Resource pressure by instruction: [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions: - - - - - - - - xor eax, eax - - - - - 1.00 - - ret
Implementors
impl FromZeros for ()impl FromZeros for AtomicBoolimpl FromZeros for AtomicI16impl FromZeros for AtomicI32impl FromZeros for AtomicI64impl FromZeros for AtomicI8impl FromZeros for AtomicIsizeimpl FromZeros for AtomicU16impl FromZeros for AtomicU32impl FromZeros for AtomicU64impl FromZeros for AtomicU8impl FromZeros for AtomicUsizeimpl FromZeros for Option<NonZeroI128>impl FromZeros for Option<NonZeroI16>impl FromZeros for Option<NonZeroI32>impl FromZeros for Option<NonZeroI64>impl FromZeros for Option<NonZeroI8>impl FromZeros for Option<NonZeroIsize>impl FromZeros for Option<NonZeroU128>impl FromZeros for Option<NonZeroU16>impl FromZeros for Option<NonZeroU32>impl FromZeros for Option<NonZeroU64>impl FromZeros for Option<NonZeroU8>impl FromZeros for Option<NonZeroUsize>impl FromZeros for __m128impl FromZeros for __m128dimpl FromZeros for __m128iimpl FromZeros for __m256impl FromZeros for __m256dimpl FromZeros for __m256iimpl FromZeros for __m512impl FromZeros for __m512bhimpl FromZeros for __m512dimpl FromZeros for __m512iimpl FromZeros for boolimpl FromZeros for charimpl FromZeros for f32impl FromZeros for f64impl FromZeros for i128impl FromZeros for i16impl FromZeros for i32impl FromZeros for i64impl FromZeros for i8impl FromZeros for isizeimpl FromZeros for strimpl FromZeros for u128impl FromZeros for u16impl FromZeros for u32impl FromZeros for u64impl FromZeros for u8impl FromZeros for usizeimpl<A, B, C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>impl<A, B, C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>impl<A, B, C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>impl<A, B, C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>impl<A: FromZeros> FromZeros for (A,)impl<A: FromZeros, B: FromZeros> FromZeros for (A, B)impl<A: FromZeros, B: FromZeros, C: FromZeros> FromZeros for (A, B, C)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros> FromZeros for (A, B, C, D)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros> FromZeros for (A, B, C, D, E)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros> FromZeros for (A, B, C, D, E, F)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros> FromZeros for (A, B, C, D, E, F, G)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros> FromZeros for (A, B, C, D, E, F, G, H)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros, R: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros, R: FromZeros, S: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros, R: FromZeros, S: FromZeros, T: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros, R: FromZeros, S: FromZeros, T: FromZeros, U: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros, R: FromZeros, S: FromZeros, T: FromZeros, U: FromZeros, V: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros, R: FromZeros, S: FromZeros, T: FromZeros, U: FromZeros, V: FromZeros, W: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros, R: FromZeros, S: FromZeros, T: FromZeros, U: FromZeros, V: FromZeros, W: FromZeros, X: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros, R: FromZeros, S: FromZeros, T: FromZeros, U: FromZeros, V: FromZeros, W: FromZeros, X: FromZeros, Y: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y)impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros, H: FromZeros, I: FromZeros, J: FromZeros, K: FromZeros, L: FromZeros, M: FromZeros, N: FromZeros, O: FromZeros, P: FromZeros, Q: FromZeros, R: FromZeros, S: FromZeros, T: FromZeros, U: FromZeros, V: FromZeros, W: FromZeros, X: FromZeros, Y: FromZeros, Z: FromZeros> FromZeros for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)impl<B, C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<extern "C" fn(B, C, D, E, F, G, H, I, J, K, L) -> M>impl<B, C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<fn(B, C, D, E, F, G, H, I, J, K, L) -> M>impl<B, C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe extern "C" fn(B, C, D, E, F, G, H, I, J, K, L) -> M>impl<B, C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe fn(B, C, D, E, F, G, H, I, J, K, L) -> M>impl<C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<extern "C" fn(C, D, E, F, G, H, I, J, K, L) -> M>impl<C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<fn(C, D, E, F, G, H, I, J, K, L) -> M>impl<C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe extern "C" fn(C, D, E, F, G, H, I, J, K, L) -> M>impl<C, D, E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe fn(C, D, E, F, G, H, I, J, K, L) -> M>impl<D, E, F, G, H, I, J, K, L, M> FromZeros for Option<extern "C" fn(D, E, F, G, H, I, J, K, L) -> M>impl<D, E, F, G, H, I, J, K, L, M> FromZeros for Option<fn(D, E, F, G, H, I, J, K, L) -> M>impl<D, E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe extern "C" fn(D, E, F, G, H, I, J, K, L) -> M>impl<D, E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe fn(D, E, F, G, H, I, J, K, L) -> M>impl<E, F, G, H, I, J, K, L, M> FromZeros for Option<extern "C" fn(E, F, G, H, I, J, K, L) -> M>impl<E, F, G, H, I, J, K, L, M> FromZeros for Option<fn(E, F, G, H, I, J, K, L) -> M>impl<E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe extern "C" fn(E, F, G, H, I, J, K, L) -> M>impl<E, F, G, H, I, J, K, L, M> FromZeros for Option<unsafe fn(E, F, G, H, I, J, K, L) -> M>impl<F, G, H, I, J, K, L, M> FromZeros for Option<extern "C" fn(F, G, H, I, J, K, L) -> M>impl<F, G, H, I, J, K, L, M> FromZeros for Option<fn(F, G, H, I, J, K, L) -> M>impl<F, G, H, I, J, K, L, M> FromZeros for Option<unsafe extern "C" fn(F, G, H, I, J, K, L) -> M>impl<F, G, H, I, J, K, L, M> FromZeros for Option<unsafe fn(F, G, H, I, J, K, L) -> M>impl<G, H, I, J, K, L, M> FromZeros for Option<extern "C" fn(G, H, I, J, K, L) -> M>impl<G, H, I, J, K, L, M> FromZeros for Option<fn(G, H, I, J, K, L) -> M>impl<G, H, I, J, K, L, M> FromZeros for Option<unsafe extern "C" fn(G, H, I, J, K, L) -> M>impl<G, H, I, J, K, L, M> FromZeros for Option<unsafe fn(G, H, I, J, K, L) -> M>impl<H, I, J, K, L, M> FromZeros for Option<extern "C" fn(H, I, J, K, L) -> M>impl<H, I, J, K, L, M> FromZeros for Option<fn(H, I, J, K, L) -> M>impl<H, I, J, K, L, M> FromZeros for Option<unsafe extern "C" fn(H, I, J, K, L) -> M>impl<H, I, J, K, L, M> FromZeros for Option<unsafe fn(H, I, J, K, L) -> M>impl<I, J, K, L, M> FromZeros for Option<extern "C" fn(I, J, K, L) -> M>impl<I, J, K, L, M> FromZeros for Option<fn(I, J, K, L) -> M>impl<I, J, K, L, M> FromZeros for Option<unsafe extern "C" fn(I, J, K, L) -> M>impl<I, J, K, L, M> FromZeros for Option<unsafe fn(I, J, K, L) -> M>impl<J, K, L, M> FromZeros for Option<extern "C" fn(J, K, L) -> M>impl<J, K, L, M> FromZeros for Option<fn(J, K, L) -> M>impl<J, K, L, M> FromZeros for Option<unsafe extern "C" fn(J, K, L) -> M>impl<J, K, L, M> FromZeros for Option<unsafe fn(J, K, L) -> M>impl<K, L, M> FromZeros for Option<extern "C" fn(K, L) -> M>impl<K, L, M> FromZeros for Option<fn(K, L) -> M>impl<K, L, M> FromZeros for Option<unsafe extern "C" fn(K, L) -> M>impl<K, L, M> FromZeros for Option<unsafe fn(K, L) -> M>impl<L, M> FromZeros for Option<extern "C" fn(L) -> M>impl<L, M> FromZeros for Option<fn(L) -> M>impl<L, M> FromZeros for Option<unsafe extern "C" fn(L) -> M>impl<L, M> FromZeros for Option<unsafe fn(L) -> M>impl<M> FromZeros for Option<extern "C" fn() -> M>impl<M> FromZeros for Option<fn() -> M>impl<M> FromZeros for Option<unsafe extern "C" fn() -> M>impl<M> FromZeros for Option<unsafe fn() -> M>impl<O> FromZeros for F32<O> where [u8; 4]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for F64<O> where [u8; 8]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for I128<O> where [u8; 16]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for I16<O> where [u8; 2]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for I32<O> where [u8; 4]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for I64<O> where [u8; 8]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for Isize<O> where [u8; 8]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for U128<O> where [u8; 16]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for U16<O> where [u8; 2]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for U32<O> where [u8; 4]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for U64<O> where [u8; 8]: FromZeros, PhantomData<O>: FromZeros,impl<O> FromZeros for Usize<O> where [u8; 8]: FromZeros, PhantomData<O>: FromZeros,impl<T> FromZeros for *const Timpl<T> FromZeros for *mut Timpl<T> FromZeros for AtomicPtr<T>impl<T> FromZeros for CoreMaybeUninit<T>impl<T> FromZeros for Option<&T>impl<T> FromZeros for Option<&mut T>impl<T> FromZeros for Option<NonNull<T>>impl<T> FromZeros for Unalign<T> where T: FromZeros,impl<T: ?Sized + FromZeros> FromZeros for Cell<T>impl<T: ?Sized + FromZeros> FromZeros for ManuallyDrop<T>impl<T: ?Sized + FromZeros> FromZeros for ReadOnly<T>impl<T: ?Sized + FromZeros> FromZeros for UnsafeCell<T>impl<T: ?Sized> FromZeros for PhantomData<T>impl<T: FromZeros> FromZeros for Wrapping<T>impl<T: FromZeros> FromZeros for [T]impl<T: FromZeros, const N: usize> FromZeros for [T; N]