pub struct MapBorrowed<S, F>(pub S, pub F);
Expand description
Maps using a closure on index; see SliceBorrowed::map
.
Tuple Fields§
§0: S
§1: F
Trait Implementations§
Source§impl<S: Clone, F: Clone> Clone for MapBorrowed<S, F>
impl<S: Clone, F: Clone> Clone for MapBorrowed<S, F>
Source§fn clone(&self) -> MapBorrowed<S, F>
fn clone(&self) -> MapBorrowed<S, F>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T, S, F, U> Debug for MapBorrowed<S, F>
impl<T, S, F, U> Debug for MapBorrowed<S, F>
Source§impl<T, S, O, F, U, V> PartialEq<O> for MapBorrowed<S, F>
impl<T, S, O, F, U, V> PartialEq<O> for MapBorrowed<S, F>
Source§impl<S, F, U> Slice for MapBorrowed<S, F>
impl<S, F, U> Slice for MapBorrowed<S, F>
Source§type Output = U
type Output = U
The type this slice returns; analagous to
Index::Output
.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<S, F, U> SliceOwned for MapBorrowed<S, F>
impl<S, F, U> SliceOwned for MapBorrowed<S, F>
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<S: Copy, F: Copy> Copy for MapBorrowed<S, F>
Auto Trait Implementations§
impl<S, F> Freeze for MapBorrowed<S, F>
impl<S, F> RefUnwindSafe for MapBorrowed<S, F>where
S: RefUnwindSafe,
F: RefUnwindSafe,
impl<S, F> Send for MapBorrowed<S, F>
impl<S, F> Sync for MapBorrowed<S, F>
impl<S, F> Unpin for MapBorrowed<S, F>
impl<S, F> UnwindSafe for MapBorrowed<S, F>where
S: UnwindSafe,
F: 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