Trait sp_runtime::traits::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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

§

type Outcome = <N as TypedGet>::Type

source§

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

§

type Outcome = T1

source§

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

§

type Outcome = T1

source§

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

§

type Outcome = T1

source§

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

§

type Outcome = T1

source§

impl<T> Morph<T> for Identity

A structure that performs identity conversion.

§

type Outcome = T

source§

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

§

type Outcome = T

source§

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

§

type Outcome = <V as TypedGet>::Type