pub struct ConcurrentStringPool { /* private fields */ }Expand description
Thread-safe string pool using a concurrent hashmap.
This version uses a parking_lot RwLock for thread-safe access.
Suitable for multi-threaded dictionary building.
Implementations§
Source§impl ConcurrentStringPool
impl ConcurrentStringPool
Sourcepub fn new() -> ConcurrentStringPool
pub fn new() -> ConcurrentStringPool
Creates a new empty concurrent string pool.
Sourcepub fn with_capacity(capacity: usize) -> ConcurrentStringPool
pub fn with_capacity(capacity: usize) -> ConcurrentStringPool
Creates a concurrent string pool with the specified capacity.
Sourcepub fn intern(&self, s: &str) -> Arc<str>
pub fn intern(&self, s: &str) -> Arc<str>
Interns a string, returning a reference-counted handle.
Sourcepub fn stats(&self) -> StringPoolStats
pub fn stats(&self) -> StringPoolStats
Returns statistics about the string pool.
Trait Implementations§
Source§impl Debug for ConcurrentStringPool
impl Debug for ConcurrentStringPool
Source§impl Default for ConcurrentStringPool
impl Default for ConcurrentStringPool
Source§fn default() -> ConcurrentStringPool
fn default() -> ConcurrentStringPool
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ConcurrentStringPool
impl RefUnwindSafe for ConcurrentStringPool
impl Send for ConcurrentStringPool
impl Sync for ConcurrentStringPool
impl Unpin for ConcurrentStringPool
impl UnsafeUnpin for ConcurrentStringPool
impl UnwindSafe for ConcurrentStringPool
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