soa-derive
soa-derive copied to clipboard
Array of Struct to Struct of Array helpers in Rust
As it stands, this crate appears to make separate fields each with their own `Vec`. This would duplicate the length and capacity values for each field. This may not be...
I think it would be nice to generate a type like: ```rust pub struct FooArray { pub f1: [f32; N], pub f2: [u8; N], ... } ``` This would allow...
Sometimes we derive serde's `Serialize/Deserialize` for Struct of Array, by `#[soa_derive(Serialize, Deserialize)]`. By feature from #42, we are able to skip some Struct of Array's fields by `#[soa_attr(Vec, serde(skip))]`, for...
#42
Sometimes we want to add attribute to generated struct's field. For example: ```rust #[derive(StructOfArray)] #[soa_derive(Serialize, Deserialize)] struct Point { x: f32, y: f32, // Skip serialization for PointVec::meta #[soa_attr(Vec, serde(skip))]...
If I have something like: ``` struct Foo { x: T } ``` the derive command causes errors.
The current doc-generation code looks like: https://github.com/lumol-org/soa-derive/blob/d16585c/soa-derive-internal/src/vec.rs#L54-L56 As a result, it introduces extra spaces due to markdown translating newlines to spaces: > http://lumol.org/soa-derive/soa_derive_example/struct.ParticleVec.html#impl-2 > With rust-lang/rust#78837 I think a bit...
Basic idea -------------- This would be using a new helper attribute to indicate that you'd like to add the fields as part of the SoA: ```rust #[derive(StructOfArray)] struct Point {...
So I've finished with a working version. Notice that there are a lot of methods missing and tests won't work because of that. Also `#sao_derive` and `zip_iter!` not implemented for...