Struct deadpool::managed::PoolBuilder [−][src]
pub struct PoolBuilder<M, W = Object<M>> where
M: Manager,
W: From<Object<M>>, { /* fields omitted */ }
managed
only.Expand description
Builder for Pool
s.
Instances of this are created by calling the Pool::builder()
method.
Implementations
Sets a PoolConfig
to build the Pool
with.
Sets the PoolConfig::max_size
.
Sets the PoolConfig::timeouts
.
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 Pool
s 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.