pub struct DieselPool { /* private fields */ }Implementations§
Source§impl DieselPool
impl DieselPool
pub fn new_background_worker( inner: Pool<ConnectionManager<PgConnection>>, ) -> Self
pub fn get(&self) -> Result<PgPooledConnection, PoolError>
pub fn state(&self) -> State
pub fn wait_until_healthy(&self, timeout: Duration) -> Result<(), PoolError>
Methods from Deref<Target = PgPool>§
Sourcepub fn get(&self) -> Result<PooledConnection<M>, Error>
pub fn get(&self) -> Result<PooledConnection<M>, Error>
Retrieves a connection from the pool.
Waits for at most the configured connection timeout before returning an error.
Sourcepub fn get_timeout(
&self,
timeout: Duration,
) -> Result<PooledConnection<M>, Error>
pub fn get_timeout( &self, timeout: Duration, ) -> Result<PooledConnection<M>, Error>
Retrieves a connection from the pool, waiting for at most timeout
The given timeout will be used instead of the configured connection timeout.
Sourcepub fn try_get(&self) -> Option<PooledConnection<M>>
pub fn try_get(&self) -> Option<PooledConnection<M>>
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.
Sourcepub fn test_on_check_out(&self) -> bool
pub fn test_on_check_out(&self) -> bool
Returns if the pool is configured to test connections on check out.
Sourcepub fn max_lifetime(&self) -> Option<Duration>
pub fn max_lifetime(&self) -> Option<Duration>
Returns the configured maximum connection lifetime.
Sourcepub fn idle_timeout(&self) -> Option<Duration>
pub fn idle_timeout(&self) -> Option<Duration>
Returns the configured idle connection timeout.
Sourcepub fn connection_timeout(&self) -> Duration
pub fn connection_timeout(&self) -> Duration
Returns the configured connection timeout.
Trait Implementations§
Source§impl Clone for DieselPool
impl Clone for DieselPool
Source§fn clone(&self) -> DieselPool
fn clone(&self) -> DieselPool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DieselPool
impl Debug for DieselPool
Source§impl Deref for DieselPool
impl Deref for DieselPool
Source§type Target = Pool<ConnectionManager<PgConnection>>
type Target = Pool<ConnectionManager<PgConnection>>
The resulting type after dereferencing.
Auto Trait Implementations§
impl Freeze for DieselPool
impl !RefUnwindSafe for DieselPool
impl Send for DieselPool
impl Sync for DieselPool
impl Unpin for DieselPool
impl !UnwindSafe for DieselPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self to an expression for Diesel’s query builder. Read more