soa_rs/soa_deref.rs
1use crate::{Slice, Soars};
2
3/// [`Slice`] dereferences to this type to provide getters for the individual
4/// fields as slices.
5///
6/// See [`Soars::Deref`]
7pub trait SoaDeref {
8 /// The [`Slice`] generic parameter
9 type Item: Soars;
10
11 /// Creates a new deref target from the given slice
12 fn from_slice(slice: &Slice<Self::Item>) -> &Self;
13
14 /// Creates a new mutable deref target from the given slice
15 fn from_slice_mut(slice: &mut Slice<Self::Item>) -> &mut Self;
16}