1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{Slice, Soapy};

/// [`Slice`] dereferences to this type to provide getters for the individual
/// fields as slices.
///
/// See [`Soapy::Deref`]
pub trait SoaDeref {
    /// The [`Slice`] generic parameter
    type Item: Soapy;

    /// Creates a new deref target from the given slice
    fn from_slice(slice: &Slice<Self::Item>) -> &Self;

    /// Creates a new mutable deref target from the given slice
    fn from_slice_mut(slice: &mut Slice<Self::Item>) -> &mut Self;
}