pub struct ConnectionManager { /* private fields */ }Expand description
Connection pool manager for AsyncConnection.
The first call to Manager::create holds an async mutex while attempting
to open a connection with the configured CreateMode. Concurrent callers
wait for that attempt to finish, then use CreateMode::DoNotCreate. If the
first attempt fails, the next caller retries with the original create_mode
(for idempotent modes only — Create is not retried because a sibling
connection may have already created the database).
Implementations§
Source§impl ConnectionManager
impl ConnectionManager
Sourcepub fn new(config: PoolConfig) -> Self
pub fn new(config: PoolConfig) -> Self
Creates a new connection manager.
Trait Implementations§
Source§impl Debug for ConnectionManager
impl Debug for ConnectionManager
Source§impl Manager for ConnectionManager
impl Manager for ConnectionManager
Source§type Type = AsyncConnection
type Type = AsyncConnection
Type of
super::Objects that this Manager creates and recycles.Source§type Error = Error
type Error = Error
Error that this
Manager can return when creating and/or recycling
super::Objects.Source§async fn create(&self) -> Result<AsyncConnection>
async fn create(&self) -> Result<AsyncConnection>
Creates a new instance of
Manager::Type.Source§async fn recycle(
&self,
conn: &mut AsyncConnection,
_metrics: &Metrics,
) -> RecycleResult<Self::Error>
async fn recycle( &self, conn: &mut AsyncConnection, _metrics: &Metrics, ) -> RecycleResult<Self::Error>
Tries to recycle an instance of
Manager::Type. Read moreAuto Trait Implementations§
impl Freeze for ConnectionManager
impl !RefUnwindSafe for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl UnsafeUnpin for ConnectionManager
impl !UnwindSafe for ConnectionManager
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request