pub trait Mappable<A, B> {
    type Target;

    // Required method
    fn map<F>(self, f: F) -> Self::Target
       where F: Fn(A) -> B;
}
Expand description

Convert some object into another object via some shared behaviour for each of its parts.

Required Associated Types§

source

type Target

The return type. Can be Self, but with a modified inner type, or something entirely different

Required Methods§

source

fn map<F>(self, f: F) -> Self::Targetwhere F: Fn(A) -> B,

Perform the conversion by value

Implementations on Foreign Types§

source§

impl<A, B> Mappable<A, B> for Complex<A>

§

type Target = Complex<B>

source§

fn map<F>(self, f: F) -> Self::Targetwhere F: Fn(A) -> B,

Implementors§

source§

impl<A, B> Mappable<A, B> for Real<A>

§

type Target = Real<B>