Trait substrate_abi::TryConvert
source · 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§
Required Methods§
sourcefn try_convert(a: A) -> Self::Outcome
fn try_convert(a: A) -> Self::Outcome
Make conversion.
Implementors§
source§impl TryConvert<(H160, [u8; 12])> for SubstrateAbiConverter
impl TryConvert<(H160, [u8; 12])> for SubstrateAbiConverter
type Outcome = Result<AccountId32, 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>,
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>,
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.