| Crates.io | poolshark |
| lib.rs | poolshark |
| version | 0.2.5 |
| created_at | 2025-08-23 22:30:33.143227+00 |
| updated_at | 2025-09-16 19:47:43.31588+00 |
| description | Thread safe object pool |
| homepage | |
| repository | https://github.com/estokes/poolshark |
| max_upload_size | |
| id | 1807925 |
| size | 65,669 |
This is a general purpose thread safe object pool that supports most data structures in the standard library, as well as many useful external data structures such as IndexMap, triomphe::Arc, etc.
It limits the pool size as well as the element size to prevent memory waste.
use std::sync::LazyLock;
use poolshark::Pool;
static POOL: LazyLock<Pool<Vec<String>>> = LazyLock::new(|| Pool::new(1024, 1024))
fn main() {
let mut v = POOL.take();
// do stuff with v
drop(v) // v actually goes back into the pool
}