Derive Macro pkbuffer::Castable

source ·
#[derive(Castable)]
Expand description

Derive the Castable trait for a given object.

This macro ensures that most of the safety requirements for the Castable trait are met:

  • The type does not contain any padding bytes.
  • The type’s members are also Castable.
  • The type is #[repr(C)], #[repr(transparent)], #[repr(packed)] or #[repr(align)].
  • The type must not use generics.

If one of these traits aren’t met, the derive macro will fail.