Map

Struct Map 

Source
pub struct Map<A, F> { /* private fields */ }
Expand description

Implementation behind ArrayIterator::map

Implementations§

Source§

impl<A, F> Map<A, F>

Source

pub fn new(a: A, f: F) -> Self

Create a new Map. See ArrayIterator::map

Trait Implementations§

Source§

impl<U, A, F, const N: usize> ArrayIterator<N> for Map<A, F>
where A: ArrayIterator<N>, F: Fn(A::Item) -> U,

Source§

type Item = U

Item returned by this ArrayIterator
Source§

unsafe fn next(&mut self) -> U

Get the next item out of this ArrayIterator Read more
Source§

fn map<U, F: Fn(Self::Item) -> U>(self, f: F) -> Map<Self, F>

Lazily mutate the contents of an array
Source§

fn zip<B: IntoArrayIterator<N>>(self, b: B) -> Zip<Self, B::ArrayIter>

Lazily combine two ArrayIterators into an new one
Source§

fn collect(self) -> [Self::Item; N]

Collect the contents of this ArrayIterator into an array Read more
Source§

fn unzip<A, B>(self) -> ([A; N], [B; N])
where Self: ArrayIterator<N, Item = (A, B)>,

Separate and collect the contents of the ArrayIterator into two arrays

Auto Trait Implementations§

§

impl<A, F> Freeze for Map<A, F>
where A: Freeze, F: Freeze,

§

impl<A, F> RefUnwindSafe for Map<A, F>

§

impl<A, F> Send for Map<A, F>
where A: Send, F: Send,

§

impl<A, F> Sync for Map<A, F>
where A: Sync, F: Sync,

§

impl<A, F> Unpin for Map<A, F>
where A: Unpin, F: Unpin,

§

impl<A, F> UnwindSafe for Map<A, F>
where A: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<A, const N: usize> IntoArrayIterator<N> for A
where A: ArrayIterator<N>,

Source§

type Item = <A as ArrayIterator<N>>::Item

Item returned by the ArrayIterator
Source§

type ArrayIter = A

The ArrayIterator returned
Source§

fn into_array_iter(self) -> <A as IntoArrayIterator<N>>::ArrayIter

Converts self into an ArrayIterator
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.