deferred_reference/slice_like.rs
1use crate::PointerLength;
2
3/// This trait is implemented for all slice-like structures. Currently there are only 2 of these types: arrays `[T; N]` and slices `[T]`.
4pub trait SliceLike: PointerLength {
5 /// The type of the elements held by the slice-like structure.
6 type Element;
7}
8
9impl<T> SliceLike for [T] {
10 type Element = T;
11}
12
13impl<T, const N: usize> SliceLike for [T; N] {
14 type Element = T;
15}