pub struct Manager<M: ManageConnection> { /* private fields */ }Expand description
Manager for use with r2d2 managers.
See the deadpool documentation for usage examples.
Implementations§
Trait Implementations§
Source§impl<M: ManageConnection> Manager for Manager<M>
impl<M: ManageConnection> Manager for Manager<M>
Source§type Type = SyncWrapper<<M as ManageConnection>::Connection>
type Type = SyncWrapper<<M as ManageConnection>::Connection>
Type of
super::Objects that this Manager creates and recycles.Source§type Error = <M as ManageConnection>::Error
type Error = <M as ManageConnection>::Error
Error that this
Manager can return when creating and/or recycling
super::Objects.Source§async fn create(&self) -> Result<Self::Type, Self::Error>
async fn create(&self) -> Result<Self::Type, Self::Error>
Creates a new instance of
Manager::Type.Source§async fn recycle(
&self,
obj: &mut Self::Type,
_: &Metrics,
) -> RecycleResult<Self::Error>
async fn recycle( &self, obj: &mut Self::Type, _: &Metrics, ) -> RecycleResult<Self::Error>
Tries to recycle an instance of
Manager::Type. Read moreAuto Trait Implementations§
impl<M> Freeze for Manager<M>
impl<M> RefUnwindSafe for Manager<M>where
M: RefUnwindSafe,
impl<M> Send for Manager<M>
impl<M> Sync for Manager<M>
impl<M> Unpin for Manager<M>
impl<M> UnwindSafe for Manager<M>where
M: RefUnwindSafe,
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