Returns a new pool with a maximum capacity of `cap`. This capacity is fixed over the lifetime of the pool.
(cap: usize)
| 81 | /// Returns a new pool with a maximum capacity of `cap`. |
| 82 | /// This capacity is fixed over the lifetime of the pool. |
| 83 | pub fn new(cap: usize) -> Self { |
| 84 | let inner = Arc::new(Inner::new(cap)); |
| 85 | Self { inner } |
| 86 | } |
| 87 | |
| 88 | /// Puts back an object into the pool. |
| 89 | pub fn put(&self, object: T) { |