pub struct Pool<RM>where
RM: DatabasePool,{ /* private fields */ }
Expand description
Generic connection pool of resources R
Implementations§
Source§impl<RM> Pool<RM>where
RM: DatabasePool,
impl<RM> Pool<RM>where
RM: DatabasePool,
Sourcepub fn get(self: &Arc<Self>) -> Result<PooledResource<RM>, Error<RM::Error>>
pub fn get(self: &Arc<Self>) -> Result<PooledResource<RM>, Error<RM::Error>>
Similar to get_timeout but uses the default timeout value.
Sourcepub fn get_timeout(
self: &Arc<Self>,
timeout: Duration,
) -> Result<PooledResource<RM>, Error<RM::Error>>
pub fn get_timeout( self: &Arc<Self>, timeout: Duration, ) -> Result<PooledResource<RM>, Error<RM::Error>>
Get a new resource or fail after timeout is reached.
This function will return a free resource or create a new one if there is still room for it; otherwise, it will wait for a resource to be released for reuse.
Trait Implementations§
Auto Trait Implementations§
impl<RM> !Freeze for Pool<RM>
impl<RM> RefUnwindSafe for Pool<RM>
impl<RM> Send for Pool<RM>
impl<RM> Sync for Pool<RM>
impl<RM> Unpin for Pool<RM>
impl<RM> UnwindSafe for Pool<RM>
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