Mapper

Trait Mapper 

Source
pub trait Mapper<In> {
    type Out;

    // Required method
    fn apply(&mut self, v: In) -> Self::Out;
}
Expand description

Mapper is a type that can map values from In to Out, You can implement this trait to plmap on types other than closures.

Mapper is essentially to FnMut(In) -> Out, but users can implement it without experimental features.

Required Associated Types§

Source

type Out

The output type.

Required Methods§

Source

fn apply(&mut self, v: In) -> Self::Out

Run the mapping function converting In to Out.

Implementors§

Source§

impl<A, B, F> Mapper<A> for F
where F: FnMut(A) -> B,

Source§

type Out = B