Struct gluon_base::symbol::SymbolModule [−][src]
pub struct SymbolModule<'a> { /* fields omitted */ }
Expand description
SymbolModule
wraps a Symbols
struct and adds a prefix to all symbols created by the
symbol
method.
While this prefix does not affect the uniques of a Symbol
in any way, it does make the origin
of a symbol clearer when pretty printing it
Implementations
Creates an unprefixed symbol, same as Symbols::symbol
Creates a symbol which is prefixed by the module
argument passed in new
let mut symbols = Symbols::new();
let mut symbols = SymbolModule::new(String::from("test"), &mut symbols);
assert_eq!(symbols.simple_symbol("a").as_ref(), "a");
assert_eq!(symbols.scoped_symbol("a").as_ref(), "test.a");