Skip to main content

ObjectPool

Trait ObjectPool 

Source
pub trait ObjectPool: Sized {
    type Data: 'static;

    // Provided methods
    fn request() -> Option<Object<Self>> { ... }
    fn manage(block: &'static mut ObjectBlock<Self::Data>) { ... }
}
Expand description

A singleton that manages pool::object::Objects

Required Associated Types§

Source

type Data: 'static

The data type of the objects managed by the object pool

Provided Methods§

Source

fn request() -> Option<Object<Self>>

Request a new object from the pool

Source

fn manage(block: &'static mut ObjectBlock<Self::Data>)

Adds a statically allocate object to the pool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§