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
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 Convert<AccountId32, VersionedLocatableAccount> for AccountIdToLocalLocation
impl Convert<AccountId32, VersionedLocatableAccount> for AccountIdToLocalLocation
§fn convert(account_id: AccountId32) -> VersionedLocatableAccount
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<AssetId> Convert<NativeOrWithId<AssetId>, Either<(), AssetId>> for NativeFromLeftwhere
AssetId: Ord,
impl<AssetId> Convert<NativeOrWithId<AssetId>, Either<(), AssetId>> for NativeFromLeftwhere
AssetId: Ord,
§impl<Balance, Fixed, Inc> Convert<usize, Balance> for GeometricDepositBase<Balance, Fixed, Inc>where
Balance: FixedPointOperand,
Fixed: Get<Balance>,
Inc: Get<Percent>,
impl<Balance, Fixed, Inc> Convert<usize, Balance> for GeometricDepositBase<Balance, Fixed, Inc>where
Balance: FixedPointOperand,
Fixed: Get<Balance>,
Inc: Get<Percent>,
§impl<Base, Slope, Balance> Convert<Footprint, Balance> for LinearStoragePrice<Base, Slope, Balance>
impl<Base, Slope, Balance> Convert<Footprint, Balance> for LinearStoragePrice<Base, Slope, Balance>
§impl<T> Convert<<T as Config>::AccountId, Option<Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>>> for DefaultExposureOf<T>where
T: Config,
impl<T> Convert<<T as Config>::AccountId, Option<Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>>> for DefaultExposureOf<T>where
T: Config,
§impl<T> Convert<<T as Config>::AccountId, Option<Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>>> for ExposureOf<T>where
T: Config,
impl<T> Convert<<T as Config>::AccountId, Option<Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>>> for ExposureOf<T>where
T: Config,
§impl<T> Convert<Weight, <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance> for Pallet<T>where
T: Config,
impl<T> Convert<Weight, <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance> for Pallet<T>where
T: Config,
§fn convert(
weight: Weight,
) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
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.