pub struct StringInterner { /* private fields */ }Expand description
Arena-based string interner for efficient string deduplication.
Implementations§
Source§impl StringInterner
impl StringInterner
Sourcepub fn with_capacity(string_bytes: usize, num_strings: usize) -> Self
pub fn with_capacity(string_bytes: usize, num_strings: usize) -> Self
Create an interner with pre-allocated capacity.
Sourcepub fn intern(&mut self, s: &str) -> StringId
pub fn intern(&mut self, s: &str) -> StringId
Intern a UTF-8 string. Convenience wrapper around intern_bytes.
Trait Implementations§
Source§impl Clone for StringInterner
impl Clone for StringInterner
Source§impl Debug for StringInterner
impl Debug for StringInterner
Auto Trait Implementations§
impl Forget for StringInterner
impl Freeze for StringInterner
impl Move for StringInterner
impl RefUnwindSafe for StringInternerwhere
StringId: RefUnwindSafe,
impl Send for StringInterner
impl Sync for StringInterner
impl Unpin for StringInterner
impl UnsafeUnpin for StringInternerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(u64, SmallVec<[StringId; 1]>)>: UnsafeUnpin,
PhantomData<(u32, u32)>: UnsafeUnpin,
impl UnwindSafe for StringInternerwhere
RawVecInner: UnwindSafe,
NonNull<u8>: UnwindSafe,
NonNull<StringId>: UnwindSafe,
StringId: UnwindSafe,
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