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§