iliekturtles / uom

Units of measurement -- type-safe zero-cost dimensional analysis
Apache License 2.0
1.01k stars 92 forks source link

Add a feature for bytemuck and/or zerocopy to `Quantity` #472

Open tgross35 opened 5 months ago

tgross35 commented 5 months ago

I have a use case where I would like to store a Quantity in a struct that gets sent to a GPU shader, which means it needs to be (de)serializable to/from a byte slice. To make cases like this easier, could a bytemuck feature be added? This would add #[cfg_attr(feature = "bytemuck", derive(bytemuck::Zeroable, bytemuck::Pod)] to Quantity.