MapInto

Trait MapInto 

Source
pub trait MapInto<F, U>
where F: FnOnce(Self::Elem) -> U,
{ type Cont<_T>; type Elem; // Required method fn mapi(self, f: F) -> Self::Cont<U>; }
Expand description

MapInto defines an interface for containers that can consume themselves to apply a given function onto each of their elements.

Required Associated Types§

Source

type Cont<_T>

Source

type Elem

Required Methods§

Source

fn mapi(self, f: F) -> Self::Cont<U>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<A, B, S, D, F> MapInto<F, B> for &ArrayBase<S, D, A>
where A: Clone, D: Dimension, S: Data<Elem = A>, F: Fn(A) -> B,

Source§

type Cont<V> = ArrayBase<OwnedRepr<V>, D>

Source§

type Elem = A

Source§

fn mapi(self, f: F) -> Self::Cont<B>

Source§

impl<A, B, S, D, F> MapInto<F, B> for ArrayBase<S, D, A>
where A: Clone, D: Dimension, S: Data<Elem = A>, F: Fn(A) -> B,

Source§

type Cont<V> = ArrayBase<OwnedRepr<V>, D>

Source§

type Elem = A

Source§

fn mapi(self, f: F) -> Self::Cont<B>

Source§

impl<U, V, F> MapInto<F, V> for Option<U>
where F: FnOnce(U) -> V,

Source§

type Cont<W> = Option<W>

Source§

type Elem = U

Source§

fn mapi(self, f: F) -> Self::Cont<V>

Implementors§