Struct syntax::util::interner::StrInterner[src]

pub struct StrInterner {
    // some fields omitted
}

A StrInterner differs from Interner in that it accepts &str rather than RcStr, resulting in less allocation.

Methods

impl StrInterner

When traits can extend traits, we should extend index to get []

fn new() -> StrInterner

fn prefill(init: &[&str]) -> StrInterner

fn intern(&self, val: &str) -> Name

fn gensym(&self, val: &str) -> Name

fn gensym_copy(&self, idx: Name) -> Name

Create a gensym with the same name as an existing entry.

fn get(&self, idx: Name) -> RcStr

fn get_ref<'a>(&'a self, idx: Name) -> &'a str

Returns this string with lifetime tied to the interner. Since strings may never be removed from the interner, this is safe.

fn len(&self) -> uint

fn find_equiv<Q: Hash + Equiv<RcStr>>(&self, val: &Q) -> Option<Name>

fn clear(&self)