pub trait ConversionFromAssetBalance<AssetBalance, AssetId, OutBalance> {
    type Error;

    // Required methods
    fn from_asset_balance(
        balance: AssetBalance,
        asset_id: AssetId,
    ) -> Result<OutBalance, Self::Error>;
    fn ensure_successful(asset_id: AssetId);
}
Expand description

Converts an asset balance value into balance.

Required Associated Types§

Required Methods§

source

fn from_asset_balance( balance: AssetBalance, asset_id: AssetId, ) -> Result<OutBalance, Self::Error>

source

fn ensure_successful(asset_id: AssetId)

Ensures that a conversion for the asset_id will be successful if done immediately after this call.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<AssetBalance, AssetId, OutBalance> ConversionFromAssetBalance<AssetBalance, AssetId, OutBalance> for UnityAssetBalanceConversion
where AssetBalance: Into<OutBalance>,

§

type Error = ()

source§

impl<AssetBalance, AssetId, OutBalance, C, O> ConversionFromAssetBalance<AssetBalance, AssetId, OutBalance> for UnityOrOuterConversion<C, O>
where C: Contains<AssetId>, O: ConversionFromAssetBalance<AssetBalance, AssetId, OutBalance>, AssetBalance: Into<OutBalance>,

§

type Error = <O as ConversionFromAssetBalance<AssetBalance, AssetId, OutBalance>>::Error