referrerpolicy=no-referrer-when-downgrade

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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Convert<(AssetId, AssetInstance), Result<AssetId, DispatchError>> for ExtractAssetId

Source§

impl Convert<(AssetId, AssetInstance), AssetId> for ExtractAssetId

§

impl Convert<u128, U256> for BalanceToU256

§

fn convert(n: u128) -> U256

§

impl Convert<AccountId32, VersionedLocatableAccount> for AccountIdToLocalLocation

§

fn convert(account_id: AccountId32) -> VersionedLocatableAccount

Convert a local account ID into a VersionedLocatableAccount.

This assumes the account is on the local chain (Location::here()) and has no network specification (network: None). Only use this when you’re certain the account is local.

§Warning

This conversion fills in default values (location = “here”, network = None) which may be incorrect if the account is from another chain or network.

§

impl Convert<Id, AggregateMessageOrigin> for ParaIdToSibling

§

impl Convert<U256, u128> for U256ToBalance

§

fn convert(n: U256) -> u128

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>

§

impl<Balance, Fixed, Inc> Convert<usize, Balance> for GeometricDepositBase<Balance, Fixed, Inc>
where Balance: FixedPointOperand, Fixed: Get<Balance>, Inc: Get<Percent>,

§

fn convert(queue_len: usize) -> Balance

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<M> Convert<FixedU128, FixedU128> for ConstFeeMultiplier<M>
where M: Get<FixedU128>,

Source§

impl<Mult, Min, Max, Balance> Convert<Balance, Balance> for CuratorDepositAmount<Mult, Min, Max, Balance>
where Balance: Balance, Min: Get<Option<Balance>>, Max: Get<Option<Balance>>, Mult: Get<Permill>,

Source§

fn convert(value: Balance) -> 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

Source§

impl<T> Convert<<T as Config>::AccountId, Option<()>> for UnitIdentificationOf<T>
where T: Config,

Source§

fn convert(validator: <T as Config>::AccountId) -> Option<()>

Source§

impl<T> Convert<<T as Config>::AccountId, Option<Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>>> for DefaultExposureOf<T>
where T: Config,

Source§

fn convert( validator: <T as Config>::AccountId, ) -> Option<Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>>

Source§

impl<T> Convert<Weight, <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance> for Pallet<T>
where T: Config,

Source§

fn convert( weight: Weight, ) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance

Compute the fee for the specified weight.

This fee is already adjusted by the per block fee adjustment factor and is therefore the share that the weight contributes to the overall fee of a transaction. It is mainly for informational purposes and not used in the actual fee calculation.

Source§

impl<T> Convert<T, Option<T>> for IdentityCollator

Source§

fn convert(t: T) -> Option<T>

Source§

impl<T, S, V, M, X> Convert<FixedU128, FixedU128> for TargetedFeeAdjustment<T, S, V, M, X>
where T: Config, S: Get<Perquintill>, V: Get<FixedU128>, M: Get<FixedU128>, X: Get<FixedU128>,

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>,