Skip to content

iFrogHop2Worlds/DODS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages