pub struct PoolMutex<T> { /* private fields */ }Implementations§
Source§impl<T> PoolMutex<T>where
T: Clear,
impl<T> PoolMutex<T>where
T: Clear,
pub fn new() -> Self
pub fn with_config(capacity: usize, max_size: usize) -> Self
pub fn create(self: &Arc<Self>) -> PoolObjectContainer<T>
Sourcepub fn create_with<F: FnOnce() -> T>(
self: &Arc<Self>,
f: F,
) -> PoolObjectContainer<T>
pub fn create_with<F: FnOnce() -> T>( self: &Arc<Self>, f: F, ) -> PoolObjectContainer<T>
Create an object. The FnOnce that you pass as an argument does not affect the object if it is already present in the pool. It is interesting for example when creating a “vector” to specify a capacity.
pub fn len(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for PoolMutex<T>
impl<T> !RefUnwindSafe for PoolMutex<T>
impl<T> Send for PoolMutex<T>where
T: Send,
impl<T> Sync for PoolMutex<T>where
T: Send,
impl<T> Unpin for PoolMutex<T>where
T: Unpin,
impl<T> UnwindSafe for PoolMutex<T>where
T: UnwindSafe,
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