pub struct StringInterner { /* private fields */ }Expand description
High-performance string interner using Arc<str> for zero-copy sharing
Implementations§
Source§impl StringInterner
impl StringInterner
Sourcepub fn intern(&self, s: &str) -> Arc<str> ⓘ
pub fn intern(&self, s: &str) -> Arc<str> ⓘ
Intern a string, returning an Arc<str> for efficient sharing
Sourcepub fn intern_cow(&self, s: &str) -> Cow<'static, str>
pub fn intern_cow(&self, s: &str) -> Cow<'static, str>
Intern a string and return as Cow<str> for flexible usage
Sourcepub fn stats(&self) -> InternerStatistics
pub fn stats(&self) -> InternerStatistics
Get cache statistics
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Get current cache size
Trait Implementations§
Source§impl Debug for StringInterner
impl Debug for StringInterner
Source§impl Default for StringInterner
impl Default for StringInterner
Source§fn default() -> StringInterner
fn default() -> StringInterner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for StringInterner
impl !RefUnwindSafe for StringInterner
impl Send for StringInterner
impl Sync for StringInterner
impl Unpin for StringInterner
impl UnsafeUnpin for StringInterner
impl UnwindSafe for StringInterner
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