pub struct SliceOf<A> { /* private fields */ }
Expand description
A sub-slice of a Slice
; see Slice::slice
.
Implementations§
Source§impl<A> SliceOf<A>where
A: Slice,
impl<A> SliceOf<A>where
A: Slice,
Sourcepub fn new<R: RangeBounds<usize>>(data: A, range: R) -> Option<Self>
pub fn new<R: RangeBounds<usize>>(data: A, range: R) -> Option<Self>
Creates a sub-slice; see Slice::slice
.
Trait Implementations§
Source§impl<A> Slice for SliceOf<A>where
A: Slice,
impl<A> Slice for SliceOf<A>where
A: Slice,
Source§fn get_with<W: FnMut(&Self::Output) -> R, R>(
&self,
index: usize,
f: &mut W,
) -> Option<R>
fn get_with<W: FnMut(&Self::Output) -> R, R>( &self, index: usize, f: &mut W, ) -> Option<R>
Call a closure with the indicated element, returning the result or
None
if the index was out-of-bounds. Read moreSource§fn chain<S: Slice<Output = Self::Output>>(self, other: S) -> Chain<Self, S>where
Self: Sized,
fn chain<S: Slice<Output = Self::Output>>(self, other: S) -> Chain<Self, S>where
Self: Sized,
Chains two slices together, back-to-back. Read more
Source§fn interleave<S: Slice<Output = Self::Output>>(
self,
other: S,
) -> Interleave<Self, S>where
Self: Sized,
fn interleave<S: Slice<Output = Self::Output>>(
self,
other: S,
) -> Interleave<Self, S>where
Self: Sized,
Interleaves two slices, e.g. [A, B, A, B, …]. Read more
Source§impl<A> SliceBorrowed for SliceOf<A>where
A: SliceBorrowed,
impl<A> SliceBorrowed for SliceOf<A>where
A: SliceBorrowed,
Source§fn get(&self, index: usize) -> Option<&Self::Output>
fn get(&self, index: usize) -> Option<&Self::Output>
Index the slice, returning a borrowed value.
Source§fn array_chunks<const N: usize>(&self) -> ArrayChunksBorrowed<'_, Self, N> ⓘ
fn array_chunks<const N: usize>(&self) -> ArrayChunksBorrowed<'_, Self, N> ⓘ
Return an iterator over arrays covering consecutive portions of the
slice. Read more
Source§fn array_windows<const N: usize>(&self) -> ArrayWindowsBorrowed<'_, Self, N> ⓘ
fn array_windows<const N: usize>(&self) -> ArrayWindowsBorrowed<'_, Self, N> ⓘ
Return a slice/iterator over arrays covering overlapping portions of the
slice. Read more
Source§fn chunks(&self, size: usize) -> ChunksBorrowed<'_, Self> ⓘ
fn chunks(&self, size: usize) -> ChunksBorrowed<'_, Self> ⓘ
Return an iterator over slices covering consecutive portions of the
slice. Read more
Source§fn map<F: Fn(&Self::Output) -> R, R>(self, f: F) -> MapBorrowed<Self, F>where
Self: Sized,
fn map<F: Fn(&Self::Output) -> R, R>(self, f: F) -> MapBorrowed<Self, F>where
Self: Sized,
Call a closure on index, returning a new type. Read more
Source§impl<A> SliceMut for SliceOf<A>where
A: SliceMut,
impl<A> SliceMut for SliceOf<A>where
A: SliceMut,
Source§impl<A> SliceOwned for SliceOf<A>where
A: SliceOwned,
impl<A> SliceOwned for SliceOf<A>where
A: SliceOwned,
Source§fn get_owned(&self, index: usize) -> Option<Self::Output>
fn get_owned(&self, index: usize) -> Option<Self::Output>
Index the slice, returning an owned value.
Source§fn array_chunks<const N: usize>(self) -> ArrayChunksOwned<Self, N> ⓘwhere
Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunksOwned<Self, N> ⓘwhere
Self: Sized,
Return an iterator over arrays covering consecutive portions of the
slice. Read more
Source§fn array_windows<const N: usize>(self) -> ArrayWindowsOwned<Self, N> ⓘwhere
Self: Sized,
fn array_windows<const N: usize>(self) -> ArrayWindowsOwned<Self, N> ⓘwhere
Self: Sized,
Return a slice/iterator over arrays covering overlapping portions of the
slice. Read more
Source§fn chunks(&self, size: usize) -> ChunksOwned<'_, Self> ⓘ
fn chunks(&self, size: usize) -> ChunksOwned<'_, Self> ⓘ
Return an iterator over slices covering consecutive portions of the
slice. Read more
Source§fn map<F: Fn(Self::Output) -> R, R>(self, f: F) -> MapOwned<Self, F>where
Self: Sized,
fn map<F: Fn(Self::Output) -> R, R>(self, f: F) -> MapOwned<Self, F>where
Self: Sized,
Call a closure on index, returning a new type. Read more
Source§fn iter(self) -> IterOwned<Self> ⓘwhere
Self: Sized,
fn iter(self) -> IterOwned<Self> ⓘwhere
Self: Sized,
Creates an iterator over the slice. Read more
Source§fn try_array<const N: usize>(&self) -> Option<[Self::Output; N]>
fn try_array<const N: usize>(&self) -> Option<[Self::Output; N]>
Try to collect the slice into an array, failing if the lengths don’t
match up. Read more
impl<A: Copy> Copy for SliceOf<A>
impl<A> Unique for SliceOf<A>where
A: Unique,
Auto Trait Implementations§
impl<A> Freeze for SliceOf<A>where
A: Freeze,
impl<A> RefUnwindSafe for SliceOf<A>where
A: RefUnwindSafe,
impl<A> Send for SliceOf<A>where
A: Send,
impl<A> Sync for SliceOf<A>where
A: Sync,
impl<A> Unpin for SliceOf<A>where
A: Unpin,
impl<A> UnwindSafe for SliceOf<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