Struct deadpool::managed::PoolBuilder[][src]

pub struct PoolBuilder<M, W = Object<M>> where
    M: Manager,
    W: From<Object<M>>, 
{ /* fields omitted */ }
This is supported on crate feature managed only.
Expand description

Builder for Pools.

Instances of this are created by calling the Pool::builder() method.

Implementations

Builds the Pool.

Errors

See BuildError for details.

Sets a PoolConfig to build the Pool with.

Sets the Timeouts::wait value of the PoolConfig::timeouts.

Sets the Timeouts::create value of the PoolConfig::timeouts.

Sets the Timeouts::recycle value of the PoolConfig::timeouts.

Attaches a post_create hook.

The given hook will be called each time right after a new Object has been created.

Attaches a pre_recycle hook.

The given hook will be called each time right before an Object will be recycled.

Attaches a post_recycle hook.

The given hook will be called each time right after an Object has been recycled.

Sets the Runtime.

Important

The Runtime is optional. Most Pools don’t need a Runtime. If want to utilize timeouts, however a Runtime must be specified as you will otherwise get a PoolError::NoRuntimeSpecified when trying to use Pool::timeout_get().

PoolBuilder::build() will fail with a BuildError::NoRuntimeSpecified if you try to build a Pool with timeouts and no Runtime specified.

Trait Implementations

Formats the value using the given formatter. 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

Performs the conversion.

Performs the conversion.

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.