pub struct StringPool { /* private fields */ }Expand description
String pool for reducing allocations in hot paths.
Implementations§
Source§impl StringPool
impl StringPool
Sourcepub fn get_string(&self) -> String
pub fn get_string(&self) -> String
Get a string from the pool, or create a new one if the pool is empty.
Sourcepub fn return_string(&self, s: String)
pub fn return_string(&self, s: String)
Return a string to the pool after clearing it.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StringPool
impl RefUnwindSafe for StringPool
impl Send for StringPool
impl Sync for StringPool
impl Unpin for StringPool
impl UnwindSafe for StringPool
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