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 with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
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