pub trait TryConvert<A> {
    type Outcome;

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

Extensible conversion trait. Generic over only source type, with destination type being associated. This being associated over outcome allows us to implement for any Type over some provider struct, allowing us to minimise the need for newtypes if using TryFrom.

Required Associated Types§

source

type Outcome

The type into which A is mutated.

Required Methods§

source

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

Make conversion.

Implementors§

source§

impl TryConvert<(H160, [u8; 12])> for SubstrateAbiConverter

source§

impl TryConvert<AccountId32> for SubstrateAbiConverter

§

type Outcome = Result<H160, Error>

source§

impl<O> TryConvert<ValueMorphism<&mut &[u8], Option<O>>> for SubstrateAbiConverterwhere SubstrateAbiConverter: Convert<u32, O> + Convert<u64, O> + Convert<u128, O> + Convert<U256, O>,

Morph some bytes into Option<O> as long as O can be converted into, and the bytes representation of Some<O> exists.

source§

impl<O> TryConvert<ValueMorphism<&mut &[u8], O>> for SubstrateAbiConverterwhere SubstrateAbiConverter: Convert<u32, O> + Convert<u64, O> + Convert<u128, O> + Convert<U256, O>,

Morph some bytes into O as long as O can be converted into.