Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DODS

Data Oriented Design Structs

#[derive(SoA)]

This generates FooSoA, FooRef, FooRefMut, FooSlice, FooSliceMut, FooPtr, and FooPtrMut for a Foo struct, plus a Vec-like API on FooSoA.

Usage

#[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.

About

Data Oriented Design Structs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages