Skip to main content

Pod

Derive Macro Pod 

Source
#[derive(Pod)]
Expand description

Derive Pod for a struct.

Requirements:

  • Must be a struct (not enum or union).
  • All fields must implement Pod.
  • The struct will be given #[repr(C)] semantics (the macro adds Clone and Copy derives and the unsafe impl Pod).

§Example

#[derive(photon_ring::Pod)]
struct Tick {
    price: f64,
    volume: u32,
    _pad: u32,
}