FromZeros

Trait FromZeros 

Source
pub unsafe trait FromZeros: TryFromBytes {
    // Provided methods
    fn zero(&mut self) { ... }
    fn new_zeroed() -> Self
       where Self: Sized { ... }
}
Expand description

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.:

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

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

#[derive(FromZeros, Immutable)]
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§

Source

fn zero(&mut self)

Overwrites self with zeros.

Sets every byte in self to 0. While this is similar to doing *self = Self::new_zeroed(), it differs in that zero does not semantically drop the current value and replace it with a new one — it simply modifies the bytes of the existing value.

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

let mut header = PacketHeader {
    src_port: 100u16.to_be_bytes(),
    dst_port: 200u16.to_be_bytes(),
    length: 300u16.to_be_bytes(),
    checksum: 400u16.to_be_bytes(),
};

header.zero();

assert_eq!(header.src_port, [0, 0]);
assert_eq!(header.dst_port, [0, 0]);
assert_eq!(header.length, [0, 0]);
assert_eq!(header.checksum, [0, 0]);
§ 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
   ret
Machine 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    -      -     ret
Unsized
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]
Source

fn new_zeroed() -> Self
where Self: Sized,

Creates an instance of Self from zeroed bytes.

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

let header: PacketHeader = FromZeros::new_zeroed();

assert_eq!(header.src_port, [0, 0]);
assert_eq!(header.dst_port, [0, 0]);
assert_eq!(header.length, [0, 0]);
assert_eq!(header.checksum, [0, 0]);
§ 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
   ret
Machine 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

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 FromZeros for Option<NonZeroI8>

Source§

impl FromZeros for Option<NonZeroI16>

Source§

impl FromZeros for Option<NonZeroI32>

Source§

impl FromZeros for Option<NonZeroI64>

Source§

impl FromZeros for Option<NonZeroI128>

Source§

impl FromZeros for Option<NonZeroIsize>

Source§

impl FromZeros for Option<NonZeroU8>

Source§

impl FromZeros for Option<NonZeroU16>

Source§

impl FromZeros for Option<NonZeroU32>

Source§

impl FromZeros for Option<NonZeroU64>

Source§

impl FromZeros for Option<NonZeroU128>

Source§

impl FromZeros for Option<NonZeroUsize>

Source§

impl FromZeros for bool

Source§

impl FromZeros for char

Source§

impl FromZeros for f32

Source§

impl FromZeros for f64

Source§

impl FromZeros for i8

Source§

impl FromZeros for i16

Source§

impl FromZeros for i32

Source§

impl FromZeros for i64

Source§

impl FromZeros for i128

Source§

impl FromZeros for isize

Source§

impl FromZeros for str

Source§

impl FromZeros for u8

Source§

impl FromZeros for u16

Source§

impl FromZeros for u32

Source§

impl FromZeros for u64

Source§

impl FromZeros for u128

Source§

impl FromZeros for ()

Source§

impl FromZeros for usize

Source§

impl FromZeros for __m128

Available on x86-64 and crate feature simd only.
Source§

impl FromZeros for __m128d

Available on x86-64 and crate feature simd only.
Source§

impl FromZeros for __m128i

Available on x86-64 and crate feature simd only.
Source§

impl FromZeros for __m256

Available on x86-64 and crate feature simd only.
Source§

impl FromZeros for __m256d

Available on x86-64 and crate feature simd only.
Source§

impl FromZeros for __m256i

Available on x86-64 and crate feature simd only.
Source§

impl FromZeros for __m512

Available on x86-64 and rust=1.89.0 and crate feature simd only.
Source§

impl FromZeros for __m512bh

Available on x86-64 and rust=1.89.0 and crate feature simd only.
Source§

impl FromZeros for __m512d

Available on x86-64 and rust=1.89.0 and crate feature simd only.
Source§

impl FromZeros for __m512i

Available on x86-64 and rust=1.89.0 and crate feature simd only.
Source§

impl FromZeros for AtomicBool

Available on target_has_atomic=8 and rust=1.60.0 only.
Source§

impl FromZeros for AtomicI8

Available on target_has_atomic=8 and rust=1.60.0 only.
Source§

impl FromZeros for AtomicI16

Available on target_has_atomic=16 and rust=1.60.0 only.
Source§

impl FromZeros for AtomicI32

Available on target_has_atomic=32 and rust=1.60.0 only.
Source§

impl FromZeros for AtomicI64

Available on target_has_atomic=64 and rust=1.60.0 only.
Source§

impl FromZeros for AtomicIsize

Available on target_has_atomic=ptr and rust=1.60.0 only.
Source§

impl FromZeros for AtomicU8

Available on target_has_atomic=8 and rust=1.60.0 only.
Source§

impl FromZeros for AtomicU16

Available on target_has_atomic=16 and rust=1.60.0 only.
Source§

impl FromZeros for AtomicU32

Available on target_has_atomic=32 and rust=1.60.0 only.
Source§

impl FromZeros for AtomicU64

Available on target_has_atomic=64 and rust=1.60.0 only.
Source§

impl FromZeros for AtomicUsize

Available on target_has_atomic=ptr and rust=1.60.0 only.
Source§

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>

Source§

impl<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>

Source§

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>

Source§

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>

Source§

impl<A: FromZeros> FromZeros for (A,)

Source§

impl<A: FromZeros, B: FromZeros> FromZeros for (A, B)

Source§

impl<A: FromZeros, B: FromZeros, C: FromZeros> FromZeros for (A, B, C)

Source§

impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros> FromZeros for (A, B, C, D)

Source§

impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros> FromZeros for (A, B, C, D, E)

Source§

impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros> FromZeros for (A, B, C, D, E, F)

Source§

impl<A: FromZeros, B: FromZeros, C: FromZeros, D: FromZeros, E: FromZeros, F: FromZeros, G: FromZeros> FromZeros for (A, B, C, D, E, F, G)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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)

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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

Source§

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>

Source§

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

Source§

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>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<M> FromZeros for Option<unsafe fn() -> M>

Source§

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

Source§

impl<T> FromZeros for Option<&T>

Source§

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

Source§

impl<T> FromZeros for Option<NonNull<T>>

Source§

impl<T> FromZeros for *const T

Source§

impl<T> FromZeros for *mut T

Source§

impl<T> FromZeros for AtomicPtr<T>

Available on target_has_atomic=ptr and rust=1.60.0 only.
Source§

impl<T> FromZeros for CoreMaybeUninit<T>

Source§

impl<T: FromZeros> FromZeros for [T]

Source§

impl<T: FromZeros> FromZeros for Wrapping<T>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl<O> FromZeros for F32<O>

Source§

impl<O> FromZeros for F64<O>

Source§

impl<O> FromZeros for I16<O>

Source§

impl<O> FromZeros for I32<O>

Source§

impl<O> FromZeros for I64<O>

Source§

impl<O> FromZeros for I128<O>

Source§

impl<O> FromZeros for Isize<O>

Source§

impl<O> FromZeros for U16<O>

Source§

impl<O> FromZeros for U32<O>

Source§

impl<O> FromZeros for U64<O>

Source§

impl<O> FromZeros for U128<O>

Source§

impl<O> FromZeros for Usize<O>

Source§

impl<T: FromZeros> FromZeros for Unalign<T>