Expand description
The ObjectPool<C> class is a thread-safe queue that allows concurrent access and is
used for reusing allocated objects.
§How this works
The Pool struct can contain objects for which there is at least one implemention of the
AsPooled or TryAsPooled trait.
The AsPooled trait is used for types that can be pooled (i.e, created or modified)
without supporting failures, while the TryAsPooled trait is used for types that can
where creation or modification is fallible.
Structs§
- Object
Pool - A thread-safe queue that allows concurrent access and is used for pooling items.
- Pooled
Arc PooledArc<T>is a pooled object wrapper with an Arc to its parent pool.- Pooled
Ref PooledRef<'a, T>is a pooled object wrapper with a reference to its parent pool.- Undef
- An
AsPooledinitializer forVec<T>.
Enums§
- Pool
Option PoolOption<T>is an enum that can be either a non-pooled item or a pooled item. This is used to allow the user to choose between using a pooled item or opt out of pooling.
Traits§
- AsPooled
- Retrieve a pooled object from an
ObjectPool, creating a new one if the queue is empty. - TryAs
Pooled - Attempt to retrieve a pooled object from an
ObjectPool, creating a new one if the queue is empty.