Trait AliasStore

Source
pub trait AliasStore {
    // Required methods
    fn alias(&self, nid: &PublicKey) -> Option<Alias>;
    fn reverse_lookup(
        &self,
        alias: &Alias,
    ) -> BTreeMap<Alias, BTreeSet<PublicKey>>;
}
Expand description

A trait for different sources which can potentially return an alias.

Required Methods§

Source

fn alias(&self, nid: &PublicKey) -> Option<Alias>

Returns alias of a NodeId.

Source

fn reverse_lookup(&self, alias: &Alias) -> BTreeMap<Alias, BTreeSet<PublicKey>>

Return all the NodeIds that match the alias.

Note that the implementation may choose to allow the alias to be a substring for more dynamic queries, thus a BTreeMap is returned to return the full Alias and matching NodeIds.

Implementations on Foreign Types§

Source§

impl AliasStore for HashMap<PublicKey, Alias>

Implementors§