pub trait TryMorph<A> {
    type Outcome;

    // Required method
    fn try_morph(a: A) -> Result<Self::Outcome, ()>;
}
Expand description

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

Required Associated Types§

type Outcome

The type into which A is mutated.

Required Methods§

fn try_morph(a: A) -> Result<Self::Outcome, ()>

Make conversion.

Object Safety§

This trait is not object safe.

Implementors§

§

impl<L, M> TryMorph<<L as TypedGet>::Type> for MorphWithUpperLimit<L, M>
where L: TypedGet, <L as TypedGet>::Type: Ord, M: TryMorph<<L as TypedGet>::Type, Outcome = <L as TypedGet>::Type>,

§

type Outcome = <L as TypedGet>::Type

§

impl<N> TryMorph<<N as TypedGet>::Type> for CheckedReduceBy<N>
where N: TypedGet, <N as TypedGet>::Type: CheckedSub,

§

type Outcome = <N as TypedGet>::Type

§

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

§

type Outcome = <N as TypedGet>::Type

§

impl<T> TryMorph<T> for Identity

A structure that performs identity conversion.

§

type Outcome = T

§

impl<T, A> TryMorph<A> for TryMorphInto<T>
where A: TryInto<T>,

§

type Outcome = T

§

impl<V, X> TryMorph<X> for Replace<V>
where V: TypedGet,

§

type Outcome = <V as TypedGet>::Type