pub struct Object<T> { /* private fields */ }
Expand description

A wrapper around the actual pooled object which implements the traits Deref, DerefMut and Drop. Use this object just as if it was of type T and upon leaving scope the drop function will take care of returning it to the pool.

Implementations

Take this object from the pool permanently. This reduces the size of the pool. If needed the object can later be added back to the pool using the Pool::add or Pool::try_add methods.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

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.