referrerpolicy=no-referrer-when-downgrade
polkadot_service::runtime_traits

Trait StaticLookup

Source
pub trait StaticLookup {
    type Source: Codec + Clone + PartialEq + Debug + TypeInfo;
    type Target;

    // Required methods
    fn lookup(s: Self::Source) -> Result<Self::Target, LookupError>;
    fn unlookup(t: Self::Target) -> Self::Source;
}
Expand description

Means of changing one type into another in a manner dependent on the source type. This variant is different to Lookup in that it doesn’t (can cannot) require any context.

Required Associated Types§

Source

type Source: Codec + Clone + PartialEq + Debug + TypeInfo

Type to lookup from.

Source

type Target

Type to lookup into.

Required Methods§

Source

fn lookup(s: Self::Source) -> Result<Self::Target, LookupError>

Attempt a lookup.

Source

fn unlookup(t: Self::Target) -> Self::Source

Convert from Target back to Source.

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<A, B> StaticLookup for (A, B)
where A: StaticLookup, B: StaticLookup<Source = <A as StaticLookup>::Source, Target = <A as StaticLookup>::Target>,

Perform a StaticLookup where there are multiple lookup sources of the same type.

Source§

impl<T> StaticLookup for Pallet<T>
where T: Config,

Implementors§

Source§

impl<AccountId, AccountIndex> StaticLookup for AccountIdLookup<AccountId, AccountIndex>
where AccountId: Codec + Clone + PartialEq + Debug, AccountIndex: Codec + Clone + PartialEq + Debug, MultiAddress<AccountId, AccountIndex>: Codec + StaticTypeInfo,

Source§

type Source = MultiAddress<AccountId, AccountIndex>

Source§

type Target = AccountId

Source§

impl<T> StaticLookup for IdentityLookup<T>
where T: Codec + Clone + PartialEq + Debug + TypeInfo,