pub struct Interner { /* private fields */ }
Implementations§
Source§impl Interner
impl Interner
Sourcepub fn with_capacity(cap: usize) -> Interner
pub fn with_capacity(cap: usize) -> Interner
Create an interner with capacity cap (to the next power of two).
Sourcepub fn get_if_interned(&self, name: &str) -> Option<Interned>
pub fn get_if_interned(&self, name: &str) -> Option<Interned>
If name is interned then return it, otherwise None.
Sourcepub fn intern_static(&mut self, name: &'static str) -> Interned
pub fn intern_static(&mut self, name: &'static str) -> Interned
Intern name in this interner. Will return the existing symbol if it exists or add it and and return it if not. Use this if you already have a static str reference to avoid wasting space on making another.
Sourcepub fn intern(&mut self, name: &str) -> Interned
pub fn intern(&mut self, name: &str) -> Interned
Intern name in this interner. Will return the existing symbol if it exists or add it and return it if not.
pub fn get_string(&self, interned: Interned) -> Option<&'static str>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Interner
impl RefUnwindSafe for Interner
impl Send for Interner
impl Sync for Interner
impl Unpin for Interner
impl UnwindSafe for Interner
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