Struct slice_utils::Reverse
source · pub struct Reverse<T, A>(pub A, _);
Expand description
A reversed slice, from Slice::reverse
.
Tuple Fields§
§0: A
Implementations§
Trait Implementations§
source§impl<'a, T, A> IntoIterator for &'a Reverse<T, A>where
A: Slice<T>,
impl<'a, T, A> IntoIterator for &'a Reverse<T, A>where
A: Slice<T>,
source§impl<'a, T, A> PartialEq<&'a [T]> for Reverse<T, A>
impl<'a, T, A> PartialEq<&'a [T]> for Reverse<T, A>
source§impl<T, A, const N: usize> PartialEq<[T; N]> for Reverse<T, A>
impl<T, A, const N: usize> PartialEq<[T; N]> for Reverse<T, A>
source§impl<T: PartialEq, A: PartialEq> PartialEq for Reverse<T, A>
impl<T: PartialEq, A: PartialEq> PartialEq for Reverse<T, A>
source§impl<T, A> Slice<T> for Reverse<T, A>where
A: Slice<T>,
impl<T, A> Slice<T> for Reverse<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 moresource§impl<T, A> SliceMut<T> for Reverse<T, A>where
A: SliceMut<T>,
impl<T, A> SliceMut<T> for Reverse<T, A>where
A: SliceMut<T>,
source§fn slice_mut<R: RangeBounds<usize>>(
self,
range: R
) -> Option<SliceOfMut<T, Self>>
fn slice_mut<R: RangeBounds<usize>>( self, range: R ) -> Option<SliceOfMut<T, Self>>
Takes a mutable sub-slice, returning
None
if the range is out-of-bounds. Read moreimpl<T: Copy, A: Copy> Copy for Reverse<T, A>
impl<T: Eq, A: Eq> Eq for Reverse<T, A>
impl<T, A> StructuralPartialEq for Reverse<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for Reverse<T, A>where
A: Freeze,
impl<T, A> RefUnwindSafe for Reverse<T, A>where
A: RefUnwindSafe,
impl<T, A> Send for Reverse<T, A>where
A: Send,
impl<T, A> Sync for Reverse<T, A>where
A: Sync,
impl<T, A> Unpin for Reverse<T, A>where
A: Unpin,
impl<T, A> UnwindSafe for Reverse<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