pub struct ConnectionPool<T, P, C, V>where
T: Send + 'static,
P: Send + Sync + Clone + 'static,
C: Send + Sync + 'static,
V: Send + Sync + 'static,{ /* private fields */ }Implementations§
Source§impl<T, P, C, V> ConnectionPool<T, P, C, V>where
C: ConnectionCreator<T, P> + Send + Sync + 'static,
V: ConnectionValidator<T> + Send + Sync + 'static,
T: Send + 'static,
P: Send + Sync + Clone + 'static,
impl<T, P, C, V> ConnectionPool<T, P, C, V>where
C: ConnectionCreator<T, P> + Send + Sync + 'static,
V: ConnectionValidator<T> + Send + Sync + 'static,
T: Send + 'static,
P: Send + Sync + Clone + 'static,
pub fn new( max_size: Option<usize>, max_idle_time: Option<Duration>, connection_timeout: Option<Duration>, cleanup_config: Option<CleanupConfig>, connection_params: P, connection_creator: C, connection_validator: V, ) -> Arc<Self>
pub async fn get_connection( self: Arc<Self>, ) -> Result<PooledStream<T, P, C, V>, PoolError<C::Error>>
Sourcepub async fn stop_cleanup_task(&self)
pub async fn stop_cleanup_task(&self)
Stop the background cleanup task
Sourcepub async fn restart_cleanup_task(&self, cleanup_config: CleanupConfig)
pub async fn restart_cleanup_task(&self, cleanup_config: CleanupConfig)
Restart the background cleanup task with new configuration
Auto Trait Implementations§
impl<T, P, C, V> Freeze for ConnectionPool<T, P, C, V>
impl<T, P, C, V> !RefUnwindSafe for ConnectionPool<T, P, C, V>
impl<T, P, C, V> Send for ConnectionPool<T, P, C, V>
impl<T, P, C, V> Sync for ConnectionPool<T, P, C, V>
impl<T, P, C, V> Unpin for ConnectionPool<T, P, C, V>
impl<T, P, C, V> !UnwindSafe for ConnectionPool<T, P, C, V>
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