pub struct ManagedPool { /* private fields */ }Expand description
Managed connection pool wrapper with statistics and health monitoring
Implementations§
Source§impl ManagedPool
impl ManagedPool
pub fn new(pool: Arc<Pool<Postgres>>, config: PoolConfig) -> Self
Sourcepub async fn acquire(&self) -> Result<PoolConnection<Postgres>, PoolError>
pub async fn acquire(&self) -> Result<PoolConnection<Postgres>, PoolError>
Acquire a connection from the pool with statistics tracking and enhanced error handling
Sourcepub fn try_acquire(&self) -> Result<Option<PoolConnection<Postgres>>, PoolError>
pub fn try_acquire(&self) -> Result<Option<PoolConnection<Postgres>>, PoolError>
Try to acquire a connection from the pool immediately (non-blocking)
Sourcepub async fn begin(&self) -> Result<Transaction<'_, Postgres>, PoolError>
pub async fn begin(&self) -> Result<Transaction<'_, Postgres>, PoolError>
Begin a database transaction with statistics tracking
Sourcepub async fn health_check(&self) -> Result<Duration, PoolError>
pub async fn health_check(&self) -> Result<Duration, PoolError>
Check pool health with comprehensive error reporting
Sourcepub async fn detailed_health_check(&self) -> Result<PoolHealthReport, PoolError>
pub async fn detailed_health_check(&self) -> Result<PoolHealthReport, PoolError>
Check pool health and log detailed statistics
Sourcepub fn config(&self) -> &PoolConfig
pub fn config(&self) -> &PoolConfig
Get connection pool configuration
Auto Trait Implementations§
impl !Freeze for ManagedPool
impl !RefUnwindSafe for ManagedPool
impl Send for ManagedPool
impl Sync for ManagedPool
impl Unpin for ManagedPool
impl !UnwindSafe for ManagedPool
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