pub struct CStringPool { /* private fields */ }Expand description
A thread-safe pool of CStrings which can be readily reused with strs for ease of FFI interactions.
Implementations§
Source§impl CStringPool
impl CStringPool
Sourcepub fn new(default_string_capacity: usize) -> CStringPool
pub fn new(default_string_capacity: usize) -> CStringPool
Create a new pool with a given default capacity for newly allocated CStrings.
Sourcepub fn with_capacity(
pool_capacity: usize,
default_string_capacity: usize,
) -> CStringPool
pub fn with_capacity( pool_capacity: usize, default_string_capacity: usize, ) -> CStringPool
Create a new pool with an additional maximum capacity. Allocating new CStrings when the
pool is at capacity will block until a new CString is available.
Trait Implementations§
Source§impl Clone for CStringPool
impl Clone for CStringPool
Source§fn clone(&self) -> CStringPool
fn clone(&self) -> CStringPool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CStringPool
impl !RefUnwindSafe for CStringPool
impl Send for CStringPool
impl Sync for CStringPool
impl Unpin for CStringPool
impl !UnwindSafe for CStringPool
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