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]

[src]

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

All parameters are initialized to their default values.

[src]

The maximum number of connections managed by the pool.

Defaults to 10.

[src]

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).

[src]

Deprecated since 0.7.4

: use thread_pool directly

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

Defaults to 3.

[src]

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.

[src]

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

Defaults to true.

[src]

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

Defaults to 10 minutes.

[src]

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.

[src]

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

Defaults to 30 seconds.

[src]

The handler for error reported in the pool.

Defaults to r2d2::LoggingErrorHandler.

[src]

The connection customizer used by the pool.

Defaults to r2d2::NopConnectionCustomizer.

[src]

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

Defaults to a new pool with helper_threads threads.

Trait Implementations

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

[src]

Formats the value using the given formatter.

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

[src]

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