Struct static_slicing::SliceWrapper
source · #[repr(transparent)]pub struct SliceWrapper<'a, I, T>(_, _, _);Expand description
Wrapper around slice references to add support for the static index types.
Due to language weirdness, we can’t implement Index and IndexMut
with static indexes for both [T] and [T; N]. As a result, we need this
wrapper type.
For convenience, SliceWrapper also implements Deref and DerefMut.
This allows SliceWrapper instances to be converted to &[T], in addition to
allowing all the underlying functions of T to be used.
Implementations§
Trait Implementations§
source§impl<'a, I, T> Deref for SliceWrapper<'a, I, T>
impl<'a, I, T> Deref for SliceWrapper<'a, I, T>
source§impl<'a, I, T> DerefMut for SliceWrapper<'a, I, T>
impl<'a, I, T> DerefMut for SliceWrapper<'a, I, T>
source§impl<I, S: AsRef<[I]>, const INDEX: usize> Index<StaticIndex<INDEX>> for SliceWrapper<'_, I, S>
impl<I, S: AsRef<[I]>, const INDEX: usize> Index<StaticIndex<INDEX>> for SliceWrapper<'_, I, S>
source§impl<I, S: AsRef<[I]>, const START: usize, const LENGTH: usize> Index<StaticRangeIndex<START, LENGTH>> for SliceWrapper<'_, I, S>
impl<I, S: AsRef<[I]>, const START: usize, const LENGTH: usize> Index<StaticRangeIndex<START, LENGTH>> for SliceWrapper<'_, I, S>
§type Output = [I; LENGTH]
type Output = [I; LENGTH]
The returned type after indexing.