Struct mobc::Pool[][src]

pub struct Pool<M: Manager>(_);
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.

Sets the maximum number of connections managed by the pool.

0 means unlimited, defaults to 10.

Sets the maximum idle connection count maintained by the pool.

The pool will maintain at most this many idle connections at all times, while respecting the value of max_open.

Defaults to 2.

Sets the maximum lifetime of connections in the pool.

Expired connections may be closed lazily before reuse.

None meas reuse forever. Defaults to None.

Panics

Panics if max_lifetime is the zero Duration.

Returns a single connection by either opening a new connection or returning an existing connection from the connection pool. Conn will block until either a connection is returned or timeout.

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

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

Returns information about the current state of the pool.

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

Executes the destructor for this 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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.