Struct r2d2::Config [] [src]

pub struct Config<C, E> { /* fields omitted */ }

A struct specifying the runtime configuration of a pool.

Config implements Default, which provides a set of reasonable default values. It can be constructed using a Builder.

Methods

impl<C, E: Error> Config<C, E>
[src]

Creates a new Builder which can be used to construct a customized Config.

All parameters are initialized to their default values.

The maximum number of connections managed by the pool.

Defaults to 10.

If set, the pool will try to maintain at least this many idle connections at all times, while respecting the value of pool_size.

Defaults to None (equivalent to the value of pool_size).

The number of threads that the pool will use for asynchronous operations such as connection creation and health checks.

Defaults to 3.

If true, the health of a connection will be verified via a call to ConnectionManager::is_valid before it is checked out of the pool.

Defaults to true.

If true, Pool::new will synchronously initialize its connections, returning an error if they could not be created.

Defaults to true.

If set, connections will be closed after sitting idle for at most 30 seconds beyond this duration.

Defaults to 10 minutes.

If set, connections will be closed after existing for at most 30 seconds beyond 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.

Calls to Pool::get will wait this long for a connection to become available before returning an error.

Defaults to 30 seconds.

The handler for error reported in the pool.

Defaults to r2d2::LoggingErrorHandler.

The connection customizer used by the pool.

Defaults to r2d2::NopConnectionCustomizer.

Trait Implementations

impl<C, E> Debug for Config<C, E>
[src]

Formats the value using the given formatter.

impl<C, E: Error> Default for Config<C, E>
[src]

Returns the "default value" for a type. Read more