Struct simple_pool::ResourcePool [−][src]
pub struct ResourcePool<T> {
pub holder: Arc<Mutex<ResourceHolder<T>>>,
}Expand description
Versatile resource pool
Fields
holder: Arc<Mutex<ResourceHolder<T>>>Implementations
Create new resource pool with pre-allocated capacity
The size parameter is used to pre-allocate memory for the resource holder only
Append resource to the pool
Panics
This function might panic when called if the resource lock is already held by the current thread
Get resource from the pool or wait until one is available