pub struct StringInterner<'a> { /* private fields */ }
Expand description
A string interner hands out Interned copies of each unique string given to it.
Implementations§
Source§impl StringInterner<'static>
impl StringInterner<'static>
Source§impl<'a> StringInterner<'a>
impl<'a> StringInterner<'a>
Sourcepub fn new(arena: DroplessArena<'a>) -> Self
pub fn new(arena: DroplessArena<'a>) -> Self
Creates a new StringInterner backed by the provided [DroplessArena]
Sourcepub fn get_or_insert(&'a self, value: &str) -> Interned<'a, str>
pub fn get_or_insert(&'a self, value: &str) -> Interned<'a, str>
Trait Implementations§
Source§impl Debug for StringInterner<'_>
impl Debug for StringInterner<'_>
Source§impl<'a> Default for StringInterner<'a>
impl<'a> Default for StringInterner<'a>
Source§fn default() -> StringInterner<'a>
fn default() -> StringInterner<'a>
Returns the “default value” for a type. Read more
Source§impl Display for StringInterner<'_>
impl Display for StringInterner<'_>
impl Send for StringInterner<'_>
impl Sync for StringInterner<'_>
Auto Trait Implementations§
impl<'a> !Freeze for StringInterner<'a>
impl<'a> !RefUnwindSafe for StringInterner<'a>
impl<'a> Unpin for StringInterner<'a>
impl<'a> UnwindSafe for StringInterner<'a>
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