Trait Morph

Source
pub trait Morph<A> {
    type Outcome;

    // Required method
    fn morph(a: A) -> Self::Outcome;
}
Expand description

Extensible conversion trait. Generic over only source type, with destination type being associated.

Required Associated Types§

Source

type Outcome

The type into which A is mutated.

Required Methods§

Source

fn morph(a: A) -> Self::Outcome

Make conversion.

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.

Implementors§

Source§

impl<N: TypedGet> Morph<<N as TypedGet>::Type> for ReduceBy<N>
where N::Type: CheckedSub + Zero,

Source§

impl<T1> Morph<(T1,)> for TakeFirst

Source§

type Outcome = T1

Source§

impl<T1, T2> Morph<(T1, T2)> for TakeFirst

Source§

type Outcome = T1

Source§

impl<T1, T2, T3> Morph<(T1, T2, T3)> for TakeFirst

Source§

type Outcome = T1

Source§

impl<T1, T2, T3, T4> Morph<(T1, T2, T3, T4)> for TakeFirst

Source§

type Outcome = T1

Source§

impl<T> Morph<T> for Identity

A structure that performs identity conversion.

Source§

impl<T, A: Into<T>> Morph<A> for MorphInto<T>

Source§

impl<V: Default, X> Morph<X> for ReplaceWithDefault<V>

Source§

impl<V: TypedGet, X> Morph<X> for Replace<V>