pinned_pool

Crates.iopinned_pool
lib.rspinned_pool
version0.1.22
created_at2025-06-20 12:45:05.602013+00
updated_at2025-08-18 17:06:06.528972+00
descriptionAn object pool that guarantees pinning of its items and enables easy item access via unsafe code by not maintaining any Rust references to its items
homepage
repositoryhttps://github.com/folo-rs/folo
max_upload_size
id1719571
size161,291
Sander Saares (sandersaares)

documentation

README

An object pool that guarantees pinning of its items and enables easy item access via unsafe code by not maintaining any Rust references to its items.

use pinned_pool::PinnedPool;

let mut pool = PinnedPool::<String>::new();

// Inserting an item gives you a key that you can later use to look up the item again.
let alice_key = pool.insert("Alice".to_string());
let bob_key = pool.insert("Bob".to_string());
let charlie_key = pool.insert("Charlie".to_string());

// Retrieving items from a pool is fast, similar to `Vec[key]`.
let alice = pool.get(alice_key);
println!("Retrieved item: {alice}");

pool.remove(bob_key);
pool.remove(charlie_key);

// You can also modify the items in-place.
let mut alice = pool.get_mut(alice_key);
alice.push_str(" Smith");
println!("Modified item: {alice}");

More details in the package documentation.

This is part of the Folo project that provides mechanisms for high-performance hardware-aware programming in Rust.

Commit count: 810

cargo fmt