Struct slice_utils::SliceOf
source · pub struct SliceOf<T, A: Slice<T>> { /* private fields */ }Expand description
An immutable sub-slice of a Slice, from Slice::slice.
Implementations§
Trait Implementations§
source§impl<'a, T, A> IntoIterator for &'a SliceOf<T, A>where
A: Slice<T>,
impl<'a, T, A> IntoIterator for &'a SliceOf<T, A>where
A: Slice<T>,
source§impl<'a, T, A> PartialEq<&'a [T]> for SliceOf<T, A>
impl<'a, T, A> PartialEq<&'a [T]> for SliceOf<T, A>
source§impl<T, A, const N: usize> PartialEq<[T; N]> for SliceOf<T, A>
impl<T, A, const N: usize> PartialEq<[T; N]> for SliceOf<T, A>
source§impl<T: PartialEq, A: PartialEq + Slice<T>> PartialEq for SliceOf<T, A>
impl<T: PartialEq, A: PartialEq + Slice<T>> PartialEq for SliceOf<T, A>
source§impl<T, A> Slice<T> for SliceOf<T, A>where
A: Slice<T>,
impl<T, A> Slice<T> for SliceOf<T, A>where
A: Slice<T>,
source§fn slice<R: RangeBounds<usize>>(self, range: R) -> Option<SliceOf<T, Self>>
fn slice<R: RangeBounds<usize>>(self, range: R) -> Option<SliceOf<T, Self>>
Takes a sub-slice, returning
None if the range is out-of-bounds. Read moresource§fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, Self, N> ⓘ
fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, Self, N> ⓘ
Returns an iterator over const-size chunks: the equivalent of
slice::array_chunks. All the chunks are guaranteed to be the same
size: items at the end will be skipped if there aren’t enough to fill a
chunk. Read moresource§fn array_chunks_exact<const N: usize>(
&self
) -> Option<ArrayChunks<'_, T, Self, N>>
fn array_chunks_exact<const N: usize>( &self ) -> Option<ArrayChunks<'_, T, Self, N>>
Returns an iterator over fixed-size chunks. If
data.len() is not
divisible by size, returns None. Otherwise, equivalent to
array_chunks. Read moresource§fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, Self, N> ⓘ
fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, Self, N> ⓘ
Returns an iterator over overlapping slices of length
size:
the equivalent of slice::array_windows. Read moresource§fn chain<O: Slice<T>>(self, other: O) -> Chain<T, Self, O>
fn chain<O: Slice<T>>(self, other: O) -> Chain<T, Self, O>
Chains two slices together, back-to-back: the equivalent of
Iterator::chain. Read moresource§fn chunks(&self, size: usize) -> Chunks<'_, T, Self> ⓘ
fn chunks(&self, size: usize) -> Chunks<'_, T, Self> ⓘ
Returns an iterator over fixed-size chunks: the equivalent of
slice::chunks. The last chunk may be smaller than the rest. Read moresource§fn cycle(self) -> Cycle<T, Self>
fn cycle(self) -> Cycle<T, Self>
Repeats the slice forever: the equivalent of
Iterator::cycle. Read moresource§fn interleave<O: Slice<T>>(self, other: O) -> Interleave<T, Self, O>
fn interleave<O: Slice<T>>(self, other: O) -> Interleave<T, Self, O>
Interleaves two slices, e.g. [A, B, A, B, …]. Read more
source§fn reverse(self) -> Reverse<T, Self>
fn reverse(self) -> Reverse<T, Self>
Reverses the slice: the equivalent of
Iterator::rev. Read moreimpl<T: Copy, A: Copy + Slice<T>> Copy for SliceOf<T, A>
impl<T: Eq, A: Eq + Slice<T>> Eq for SliceOf<T, A>
impl<T, A: Slice<T>> StructuralPartialEq for SliceOf<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for SliceOf<T, A>where
A: Freeze,
impl<T, A> RefUnwindSafe for SliceOf<T, A>where
A: RefUnwindSafe,
impl<T, A> Send for SliceOf<T, A>where
A: Send,
impl<T, A> Sync for SliceOf<T, A>where
A: Sync,
impl<T, A> Unpin for SliceOf<T, A>where
A: Unpin,
impl<T, A> UnwindSafe for SliceOf<T, A>where
A: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more