pub struct ObjectPool { /* private fields */ }
Expand description

An object pool that provides the backing object storage for executors.

Implementations§

Pins an object to the pool.

Gets a handle to the object at id.

The handle can be passed around safely and the underlying object will not be garbage collected until all handles to it are released.

If the object pool gets destroyed before all handles are dropped, the process will be aborted because of memory unsafety introduced by reference invalidation.

Gets a direct reference to the object at id.

Gets a direct typed reference to the object at id. If downcast fails, None is returned.

Gets a direct reference to the object at id. If downcast fails, this raises a RuntimeError.

Gets a typed object handle to the object at id. If downcast fails, None is returned.

Gets a typed object handle to the object at id. If downcast fails, this raises a RuntimeError.

Trait Implementations§

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.