wasmtime_environ::component

Trait NameMapIntern

source
pub trait NameMapIntern {
    type Key;

    // Required methods
    fn intern(&mut self, s: &str) -> Self::Key;
    fn lookup(&self, s: &str) -> Option<Self::Key>;
}
Expand description

A helper trait used in conjunction with NameMap to optionally intern keys to non-strings.

Required Associated Types§

source

type Key

The key that this interning context generates.

Required Methods§

source

fn intern(&mut self, s: &str) -> Self::Key

Inserts s into self and returns the intern’d key Self::Key.

source

fn lookup(&self, s: &str) -> Option<Self::Key>

Looks up s in self returning Some if it was found or None if it’s not present.

Implementors§