pub trait SoaArray {
type Item: Soapy;
// Required methods
fn as_slice(&self) -> SliceRef<'_, Self::Item>;
fn as_mut_slice(&mut self) -> SliceMut<'_, Self::Item>;
}
Expand description
A compile-time, fixed-size SoA array.
What Slice
is to [T]
, SoA arrays are to [T; N]
. They are useful
whenever you have const
data you want to structure in SoA form.
When deriving Soapy
for some type Foo
, a struct FooArray
is also
created which implements this trait. The primary way to create a SoA array
is to use the FooArray::from_array
method for that type, which cannot be
included in this trait because it is const
.
Required Associated Types§
Required Methods§
Sourcefn as_mut_slice(&mut self) -> SliceMut<'_, Self::Item>
fn as_mut_slice(&mut self) -> SliceMut<'_, Self::Item>
Returns a mutable Slice
containing the entire array.