macro_rules! parameter_type_with_key { ( pub $name:ident: |$k:ident: $key:ty| -> $value:ty $body:block; ) => { ... }; }
Expand description
Create new implementations of the GetByKey
trait.
The implementation is typically used like a map or set.
Example:
ⓘ
use primitives::CurrencyId;
parameter_type_with_key! {
pub Rates: |currency_id: CurrencyId| -> u32 {
match currency_id {
CurrencyId::DOT => 1,
CurrencyId::KSM => 2,
_ => 3,
}
}
}