pub struct LockFreeInterner { /* private fields */ }Expand description
Lock-free string interner
Implementations§
Source§impl LockFreeInterner
impl LockFreeInterner
Sourcepub fn with_chunk_size(chunk_size: usize) -> Self
pub fn with_chunk_size(chunk_size: usize) -> Self
Create with custom chunk size
Sourcepub fn get_or_intern(&self, s: &str) -> Symbol
pub fn get_or_intern(&self, s: &str) -> Symbol
Get or intern a string
Sourcepub fn resolve(&self, symbol: Symbol) -> Option<&str>
pub fn resolve(&self, symbol: Symbol) -> Option<&str>
Resolve a symbol to its string (lock-free for reads!)
Sourcepub fn stats(&self) -> &InternerStats
pub fn stats(&self) -> &InternerStats
Get statistics
Sourcepub fn storage_bytes(&self) -> usize
pub fn storage_bytes(&self) -> usize
Get total memory used by string storage
Trait Implementations§
Source§impl Default for LockFreeInterner
impl Default for LockFreeInterner
impl Send for LockFreeInterner
impl Sync for LockFreeInterner
Auto Trait Implementations§
impl !Freeze for LockFreeInterner
impl !RefUnwindSafe for LockFreeInterner
impl Unpin for LockFreeInterner
impl UnwindSafe for LockFreeInterner
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more