[−][src]Struct mpool::Pool
A generic connection pool.
Methods
impl<M> Pool<M> where
M: ManageConnection,
[src]
M: ManageConnection,
pub fn new(manager: M) -> Pool<M>
[src]
Creates a new connection pool with a default configuration.
pub fn builder() -> Builder<M>
[src]
Returns a builder type to configure a new pool.
pub async fn get_timeout<'_>(
&'_ self,
connection_timeout: Option<Duration>
) -> Result<M::Connection>
[src]
&'_ self,
connection_timeout: Option<Duration>
) -> Result<M::Connection>
Retrieves a connection from the pool.
Waits for at most the connection timeout before returning an error.
pub async fn get<'_>(&'_ self) -> Result<Connection<M>>
[src]
Retrieves a connection from the pool.
Waits for at most the configured connection timeout before returning an error.
Trait Implementations
impl<M> Clone for Pool<M> where
M: ManageConnection,
[src]
M: ManageConnection,
Auto Trait Implementations
impl<M> RefUnwindSafe for Pool<M> where
M: RefUnwindSafe,
M: RefUnwindSafe,
impl<M> Send for Pool<M> where
<M as ManageConnection>::Connection: Send,
<M as ManageConnection>::Connection: Send,
impl<M> Sync for Pool<M> where
<M as ManageConnection>::Connection: Send,
<M as ManageConnection>::Connection: Send,
impl<M> Unpin for Pool<M>
impl<M> UnwindSafe for Pool<M> where
M: RefUnwindSafe,
M: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,