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.

Implementations on Foreign Types§

source§

impl<A, B> StaticLookup for (A, B)where A: StaticLookup, B: StaticLookup<Source = A::Source, Target = A::Target>,

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

§

type Source = <A as StaticLookup>::Source

§

type Target = <A as StaticLookup>::Target

source§

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

source§

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

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,

§

type Source = MultiAddress<AccountId, AccountIndex>

§

type Target = AccountId

source§

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

§

type Source = T

§

type Target = T