Infinity Pool
Object pools with trait object support and multiple access models. Provides faster alternatives to Box::pin(), Arc::pin() and Rc::pin().
Pool types
- PinnedPool - basic object pool for a single type with pinned memory guarantees
- OpaquePool - for objects with unnameable types (e.g.
impl Future) - BlindPool - accepts multiple different types in the same pool
All pools support trait object casting.
Access models
Each pool type comes in three variants:
- Thread-safe with
Arc-style handles (default) - Single-threaded with
Rc-style handles (Local*variants) - Manual lifetime management (
Raw*variants)
Example
use Display;
use ;
// Enable casting to Display trait objects
define_pooled_dyn_cast!;
/// Function that accepts anything that can be borrowed as a Display trait object
See also
More details in the package documentation.
This is part of the Folo project that provides mechanisms for high-performance hardware-aware programming in Rust.