Derive Macro bytemuck::Zeroable

source ·
Expand description

Derive the Zeroable trait for a struct

The macro ensures that the struct follows all the the safety requirements for the Zeroable trait.

The following constraints need to be satisfied for the macro to succeed

  • All fields in the struct must to implement Zeroable


#[derive(Copy, Clone, Zeroable)]
struct Test {
  a: u16,
  b: u16,