referrerpolicy=no-referrer-when-downgrade

Trait Convert

pub trait Convert<A, B> {
    // Required method
    fn convert(a: A) -> B;
}
Expand description

Infallible conversion trait. Generic over both source and destination types.

Required Methods§

fn convert(a: A) -> B

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.

Implementations on Foreign Types§

§

impl<A, B> Convert<A, B> for ()
where B: Default,

§

fn convert(_: A) -> B

Implementors§

§

impl<A, B> Convert<A, B> for ConvertInto
where A: Into<B>,

§

impl<AssetId> Convert<NativeOrWithId<AssetId>, Either<(), AssetId>> for NativeFromLeft
where AssetId: Ord,

§

impl<Base, Slope, Balance> Convert<Footprint, Balance> for LinearStoragePrice<Base, Slope, Balance>
where Base: Get<Balance>, Slope: Get<Balance>, Balance: From<u64> + Saturating,

§

impl<Price, Balance> Convert<Footprint, Balance> for ConstantStoragePrice<Price, Balance>
where Price: Get<Balance>, Balance: From<u64> + Saturating,

§

impl<T> Convert<T, T> for Identity

§

impl<X, Y, T> Convert<X, Y> for ConvertToValue<T>
where T: Get<Y>,