pub struct DBConnectionManager<D>where
D: Driver,{ /* private fields */ }Expand description
The Manager that backs every Tank connection pool.
A manager holds the Driver and the database URL; it knows how to open
new connections on demand and how to validate recycled ones. You do not
need to construct or interact with this type directly, it is created
internally by Driver::connect_pool.
Implementations§
Source§impl<D> DBConnectionManager<D>where
D: Driver,
impl<D> DBConnectionManager<D>where
D: Driver,
pub fn new(driver: D, url: Cow<'static, str>) -> DBConnectionManager<D>
Trait Implementations§
Source§impl<D> Debug for DBConnectionManager<D>
impl<D> Debug for DBConnectionManager<D>
Source§impl<D> Manager for DBConnectionManager<D>where
D: Driver,
impl<D> Manager for DBConnectionManager<D>where
D: Driver,
Source§type Type = <D as Driver>::Connection
type Type = <D as Driver>::Connection
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<<DBConnectionManager<D> as Manager>::Type, Error>
async fn create( &self, ) -> Result<<DBConnectionManager<D> as Manager>::Type, Error>
Creates a new instance of
Manager::Type.Source§fn recycle(
&self,
_: &mut <DBConnectionManager<D> as Manager>::Type,
_: &Metrics,
) -> impl Future<Output = Result<(), RecycleError<<DBConnectionManager<D> as Manager>::Error>>> + Send
fn recycle( &self, _: &mut <DBConnectionManager<D> as Manager>::Type, _: &Metrics, ) -> impl Future<Output = Result<(), RecycleError<<DBConnectionManager<D> as Manager>::Error>>> + Send
Tries to recycle an instance of
Manager::Type. Read moreAuto Trait Implementations§
impl<D> Freeze for DBConnectionManager<D>where
D: Freeze,
impl<D> RefUnwindSafe for DBConnectionManager<D>where
D: RefUnwindSafe,
impl<D> Send for DBConnectionManager<D>
impl<D> Sync for DBConnectionManager<D>
impl<D> Unpin for DBConnectionManager<D>where
D: Unpin,
impl<D> UnsafeUnpin for DBConnectionManager<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for DBConnectionManager<D>where
D: 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