pub struct Object<M: Manager> { /* private fields */ }
Available on crate feature managed only.
Expand description

Wrapper around the actual pooled object which implements Deref, DerefMut and Drop traits.

Use this object just as if it was of type T and upon leaving a scope the Drop::drop() will take care of returning it to the pool.

Implementations

Takes this Object from its Pool permanently. This reduces the size of the Pool.

Get object statistics

Returns the Pool this Object belongs to.

Since Objects only hold a Weak reference to the Pool they come from, this can fail and return None instead.

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.

Formats the value using the given formatter. Read more

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.