Struct slice_utils::Cycle
source · pub struct Cycle<T, A>(pub A, _);
Expand description
An infinitely looped slice, from Slice::cycle
.
Tuple Fields§
§0: A
Implementations§
Trait Implementations§
source§impl<'a, T, A> IntoIterator for &'a Cycle<T, A>where
A: Slice<T>,
impl<'a, T, A> IntoIterator for &'a Cycle<T, A>where
A: Slice<T>,
source§impl<'a, T, A> PartialEq<&'a [T]> for Cycle<T, A>
impl<'a, T, A> PartialEq<&'a [T]> for Cycle<T, A>
source§impl<T, A, const N: usize> PartialEq<[T; N]> for Cycle<T, A>
impl<T, A, const N: usize> PartialEq<[T; N]> for Cycle<T, A>
source§impl<T: PartialEq, A: PartialEq> PartialEq for Cycle<T, A>
impl<T: PartialEq, A: PartialEq> PartialEq for Cycle<T, A>
source§impl<T, A> Slice<T> for Cycle<T, A>where
A: Slice<T>,
impl<T, A> Slice<T> for Cycle<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 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 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 Cycle<T, A>where
A: SliceMut<T>,
impl<T, A> SliceMut<T> for Cycle<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 Cycle<T, A>
impl<T: Eq, A: Eq> Eq for Cycle<T, A>
impl<T, A> StructuralPartialEq for Cycle<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for Cycle<T, A>where
A: Freeze,
impl<T, A> RefUnwindSafe for Cycle<T, A>where
A: RefUnwindSafe,
impl<T, A> Send for Cycle<T, A>where
A: Send,
impl<T, A> Sync for Cycle<T, A>where
A: Sync,
impl<T, A> Unpin for Cycle<T, A>where
A: Unpin,
impl<T, A> UnwindSafe for Cycle<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