Struct r2d2::Pool

source ·
pub struct Pool<M>(_)
where
    M: ManageConnection
;
Expand description

A generic connection pool.

Implementations§

Creates a new connection pool with a default configuration.

Returns a builder type to configure a new pool.

Retrieves a connection from the pool.

Waits for at most the configured connection timeout before returning an error.

Retrieves a connection from the pool, waiting for at most timeout

The given timeout will be used instead of the configured connection timeout.

Attempts to retrieve a connection from the pool if there is one available.

Returns None if there are no idle connections available in the pool. This method will not block waiting to establish a new connection.

Returns information about the current state of the pool.

Returns the configured maximum pool size.

Returns the configured mimimum idle connection count.

Returns if the pool is configured to test connections on check out.

Returns the configured maximum connection lifetime.

Returns the configured idle connection timeout.

Returns the configured connection timeout.

Trait Implementations§

Returns a new Pool referencing the same state as self.

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.