pub struct ConnectionPool<P = DatabasePool> { /* private fields */ }
Expand description
A database connection pool with metadata.
Implementations§
Source§impl<P> ConnectionPool<P>
impl<P> ConnectionPool<P>
Sourcepub fn new(name: &'static str, database: &'static str, pool: P) -> Self
pub fn new(name: &'static str, database: &'static str, pool: P) -> Self
Creates a new instance.
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Returns true
if the connection pool is available.
Sourcepub fn store_availability(&self, available: bool)
pub fn store_availability(&self, available: bool)
Stores the value into the availability of the connection pool.
Sourcepub fn missed_count(&self) -> usize
pub fn missed_count(&self) -> usize
Returns the number of missed count.
Sourcepub fn increment_missed_count(&self)
pub fn increment_missed_count(&self)
Increments the missed count by 1.
Sourcepub fn reset_missed_count(&self)
pub fn reset_missed_count(&self)
Resets the number of missed count.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true
if the connection pool is retryable to connect.
Trait Implementations§
Source§impl<P: Debug> Debug for ConnectionPool<P>
impl<P: Debug> Debug for ConnectionPool<P>
Source§impl PoolManager for ConnectionPool<DatabasePool>
Available on crate feature orm-sqlx
only.
impl PoolManager for ConnectionPool<DatabasePool>
Available on crate feature
orm-sqlx
only.Auto Trait Implementations§
impl<P = Pool<Sqlite>> !Freeze for ConnectionPool<P>
impl<P> RefUnwindSafe for ConnectionPool<P>where
P: RefUnwindSafe,
impl<P> Send for ConnectionPool<P>where
P: Send,
impl<P> Sync for ConnectionPool<P>where
P: Sync,
impl<P> Unpin for ConnectionPool<P>where
P: Unpin,
impl<P> UnwindSafe for ConnectionPool<P>where
P: UnwindSafe,
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> 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 more