[−][src]Struct gluon_base::symbol::SymbolModule
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
impl<'a> SymbolModule<'a>
[src]
pub fn new(module: String, symbols: &'a mut Symbols) -> SymbolModule<'a>
[src]
pub fn simple_symbol<N>(&mut self, name: N) -> Symbol where
N: Into<NameBuf> + AsRef<Name>,
[src]
N: Into<NameBuf> + AsRef<Name>,
pub fn symbol<N>(&mut self, name: SymbolData<N>) -> Symbol where
N: Into<NameBuf> + AsRef<Name>,
[src]
N: Into<NameBuf> + AsRef<Name>,
Creates an unprefixed symbol, same as Symbols::symbol
pub fn contains_name<N>(&mut self, name: N) -> bool where
N: AsRef<Name>,
[src]
N: AsRef<Name>,
pub fn scoped_symbol(&mut self, name: &str) -> Symbol
[src]
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");
pub fn module(&self) -> &Name
[src]
pub fn len(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn symbols(&mut self) -> &mut Symbols
[src]
Trait Implementations
impl<'a> Debug for SymbolModule<'a>
[src]
impl<'s> DisplayEnv for SymbolModule<'s>
[src]
impl<'a> IdentEnv for SymbolModule<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for SymbolModule<'a>
impl<'a> Send for SymbolModule<'a>
impl<'a> Sync for SymbolModule<'a>
impl<'a> Unpin for SymbolModule<'a>
impl<'a> !UnwindSafe for SymbolModule<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
[src]
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,