Skip to main content

Convert

Trait Convert 

Source
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§

Source

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".

Implementations on Foreign Types§

Source§

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

Source§

fn convert(_: A) -> B

Source§

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

Source§

fn convert(asset: NativeOrWithId<AssetId>) -> Either<(), AssetId>

Source§

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

Source§

fn convert(a: Footprint) -> Balance

Source§

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

Source§

fn convert(_: Footprint) -> Balance

Implementors§

Source§

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

Source§

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

Source§

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