Data Oriented Design Structs
This generates FooSoA, FooRef, FooRefMut, FooSlice, FooSliceMut, FooPtr, and FooPtrMut for a Foo struct, plus a Vec-like API on FooSoA.
#[derive(SoA)]
pub struct SensorReading {
pub temperature: f32,
pub pressure: f32,
pub timestamp: u64,
} and under the hood you get
/// Generated by #[derive(SoA)]
pub struct SensorReadingSoA {
pub temperature: Vec<f32>,
pub pressure: Vec<f32>,
pub timestamp: Vec<u64>,
}You get a standard API for working with vectors/slices simplifying working with your structs.