pub struct LocalVarInterner<'str> { /* private fields */ }Expand description
Parse-time interner: maps source name strings to LocalVarIds.
Only alive during parsing — discarded once the producer has built its macro.
Implementations§
Source§impl<'str> LocalVarInterner<'str>
impl<'str> LocalVarInterner<'str>
Sourcepub fn intern(&mut self, name: &'str str) -> LocalVarId
pub fn intern(&mut self, name: &'str str) -> LocalVarId
Returns the identifier for name, allocating one on its first use.
Sourcepub fn get(&self, name: &str) -> Option<LocalVarId>
pub fn get(&self, name: &str) -> Option<LocalVarId>
Returns an existing identifier without allocating one.
Trait Implementations§
Auto Trait Implementations§
impl<'str> Freeze for LocalVarInterner<'str>
impl<'str> RefUnwindSafe for LocalVarInterner<'str>
impl<'str> Send for LocalVarInterner<'str>
impl<'str> Sync for LocalVarInterner<'str>
impl<'str> Unpin for LocalVarInterner<'str>
impl<'str> UnsafeUnpin for LocalVarInterner<'str>
impl<'str> UnwindSafe for LocalVarInterner<'str>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more