pub struct PoolEventManager { /* private fields */ }Expand description
Pool event manager that coordinates multiple event handlers
Implementations§
Source§impl PoolEventManager
impl PoolEventManager
Sourcepub fn add_handler(&self, handler: Arc<dyn PoolEventHandler>)
pub fn add_handler(&self, handler: Arc<dyn PoolEventHandler>)
Add an event handler
Sourcepub async fn emit_acquired(
&self,
pool_size: u32,
idle: u32,
wait_time: Duration,
)
pub async fn emit_acquired( &self, pool_size: u32, idle: u32, wait_time: Duration, )
Convenience method to emit connection acquired event
Sourcepub async fn emit_released(&self, pool_size: u32, idle: u32)
pub async fn emit_released(&self, pool_size: u32, idle: u32)
Convenience method to emit connection released event
Sourcepub async fn emit_timeout(&self, pool_size: u32, idle: u32, timeout: Duration)
pub async fn emit_timeout(&self, pool_size: u32, idle: u32, timeout: Duration)
Convenience method to emit timeout event
Sourcepub async fn emit_exhausted(&self, pool_size: u32)
pub async fn emit_exhausted(&self, pool_size: u32)
Convenience method to emit pool exhausted event
Trait Implementations§
Source§impl Clone for PoolEventManager
impl Clone for PoolEventManager
Source§fn clone(&self) -> PoolEventManager
fn clone(&self) -> PoolEventManager
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 moreAuto Trait Implementations§
impl Freeze for PoolEventManager
impl !RefUnwindSafe for PoolEventManager
impl Send for PoolEventManager
impl Sync for PoolEventManager
impl Unpin for PoolEventManager
impl !UnwindSafe for PoolEventManager
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> 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