Struct mobc::Pool [−][src]
pub struct Pool<M: Manager>(_);
Expand description
A generic connection pool.
Implementations
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.
Trait Implementations
Returns a new Pool
referencing the same state as self
.
Auto Trait Implementations
impl<M> !RefUnwindSafe for Pool<M>
impl<M> !UnwindSafe for Pool<M>
Blanket Implementations
Mutably borrows from an owned value. Read more