pub struct RawPool<T: RawPoolable + Send + 'static>(/* private fields */);Expand description
a lock-free, thread-safe, dynamically-sized object pool.
this pool begins with an initial capacity and will continue creating new objects on request when none are available. Pooled objects are returned to the pool on destruction.
if, during an attempted return, a pool already has
maximum_capacity objects in the pool, the pool will throw away
that object.
Implementations§
Source§impl<T: RawPoolable + Send + 'static> RawPool<T>
impl<T: RawPoolable + Send + 'static> RawPool<T>
pub fn downgrade(&self) -> WeakPool<T>
Sourcepub fn new(max_capacity: usize, max_elt_capacity: usize) -> RawPool<T>
pub fn new(max_capacity: usize, max_elt_capacity: usize) -> RawPool<T>
creates a new Pool<T>. this pool will retain up to
max_capacity objects of size less than or equal to
max_elt_capacity. Objects larger than max_elt_capacity will be
deallocated immediatly.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for RawPool<T>
impl<T> RefUnwindSafe for RawPool<T>
impl<T> Send for RawPool<T>
impl<T> Sync for RawPool<T>
impl<T> Unpin for RawPool<T>
impl<T> UnwindSafe for RawPool<T>
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