photon-ring-derive 3.0.0

Derive macro for photon-ring's Pod trait
Documentation

Derive macros for photon_ring::Pod and photon_ring::Message.

Pod derive

#[repr(C)]
#[derive(photon_ring::Pod)]
struct Quote {
    price: f64,
    volume: u32,
}

This generates compile-time assertions that every field implements Pod, plus unsafe impl photon_ring::Pod for Quote {}.

Note: The macro does not add #[repr(C)] or Clone/Copy derives. You must add those yourself for the Pod contract to hold.

Message derive

#[derive(photon_ring::Message)]
struct Order {
    price: f64,
    qty: u32,
    #[photon(as_enum)]
    side: Side,        // any #[repr(u8)] enum — requires #[photon(as_enum)]
    filled: bool,
    tag: Option<u32>,
}

Generates a Pod-compatible wire struct (OrderWire), a From<Order> for OrderWire, and a back-conversion: a safe From<OrderWire> for Order for enum-free structs, or an unsafe OrderWire::into_domain() method when #[photon(as_enum)] fields are present. See [derive_message] for details.