MapTo

Trait MapTo 

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

MapTo establishes an interface for containers capable of applying a given function onto each of their elements, by reference.

Required Associated Types§

Source

type Cont<_T>

Source

type Elem

Required Methods§

Source

fn mapt(&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, U, V, F> MapTo<F, V> for Option<&'a U>
where for<'b> F: FnOnce(&'b U) -> V,

Source§

type Cont<W> = Option<W>

Source§

type Elem = &'a U

Source§

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

Source§

impl<A, B, S, D, F> MapTo<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 mapt(&self, f: F) -> Self::Cont<B>

Implementors§