pub struct Builder { /* private fields */ }

Implementations

If true, the health of a connection will be verified when checkout.

This check uses Builder’s connection_timeout setting to cancel the check and return a timeout error.

Defaults to true.

If true, the pending connections that last for too long will be removed.( 6 times the connection_timeout duration)

This is a placeholder feature. it works fine but in most cases it’s not necessary or useful.

Defaults to false.

Sets the maximum lifetime of connections in the pool.

If set, connections will be closed at the next reaping after surviving past this duration.

If a connection reaches its maximum lifetime while checked out it will be closed when it is returned to the pool.

Defaults to 30 minutes.

Sets the idle timeout used by the pool.

If set, idle connections in excess of min_idle will be closed at the next reaping after remaining idle past this duration.

Defaults to 10 minutes.

Sets the connection reaper rate.

The connection that are idle and live beyond the time gate will be dropped.

Default 15 seconds.(no guarantee as we don’t force lock the pool)

Sets the connection timeout used by the pool.

Attempt to establish new connection to database will be canceled and return a timeout error if this Duration passed.

It’s recommended to set this duration the same or a bit longer than your database connection timeout setting.

Default 10 seconds.

Sets the wait timeout used by the queue.

Similar to connection_timeout. A timeout error will return if we wait too long for a connection from pool.

Default 20 seconds

Consumes the Builder, returning a new, initialized Pool.

Consumes the Builder, returning a new uninitialized Pool.

(Pool have no connection and scheduled tasks like connection reaper and garbage collect)

expose reaper_rate to public.

Trait Implementations

Returns the “default value” for a 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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more