[][src]Trait sp_runtime::traits::StaticLookup

pub trait StaticLookup {
    type Source: Codec + Clone + PartialEq + Debug;
    type Target;
    pub fn lookup(s: Self::Source) -> Result<Self::Target, LookupError>;
pub fn unlookup(t: Self::Target) -> Self::Source; }

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.

Associated Types

type Source: Codec + Clone + PartialEq + Debug

Type to lookup from.

type Target

Type to lookup into.

Loading content...

Required methods

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

Attempt a lookup.

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

Convert from Target back to Source.

Loading content...

Implementations on Foreign Types

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::Source

type Target = A::Target

Loading content...


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

type Source = MultiAddress<AccountId, AccountIndex>

type Target = AccountId

impl<T: Codec + Clone + PartialEq + Debug> StaticLookup for IdentityLookup<T>[src]

type Source = T

type Target = T

Loading content...