Struct moore_common::name::NameTable
[−]
[src]
pub struct NameTable { /* fields omitted */ }
A lookup table of names. Internalizes strings either in a case sensitive or case insensitive way. Allows for bidirectional lookup, i.e. by string or by assigned name.
Methods
impl NameTable
[src]
fn new() -> NameTable
[src]
Create a new empty name table.
fn intern(&self, value: &str, case_sensitive: bool) -> Name
[src]
Obtain a name for a string. This either inserts the string into the table and returns the new name, or returns the existing name if the string already exists in the table.
fn get(&self, idx: Name) -> RcStr
[src]
Retrieve the string given a name tag.
fn find<Q: ?Sized>(&self, value: &Q) -> Option<Name> where
RcStr: Borrow<Q>,
Q: Eq + Hash,
[src]
RcStr: Borrow<Q>,
Q: Eq + Hash,
Try to find a string.