Trait opool::PoolAllocator
source · pub trait PoolAllocator<T> {
// Required method
fn allocate(&self) -> T;
// Provided methods
fn reset(&self, _obj: &mut T) { ... }
fn is_valid(&self, _obj: &T) -> bool { ... }
}
Expand description
A trait defining the interface for a pool allocator.
This trait provides methods for resetting and creating new objects, as well as validating objects before they are stored back in the object pool.