pub struct Pool(/* private fields */);Implementations§
Source§impl Pool
impl Pool
pub fn new() -> Self
Sourcepub fn ensure(&mut self, db_url: &str) -> Result<(), DbError>
pub fn ensure(&mut self, db_url: &str) -> Result<(), DbError>
ensure that a connection pool for this db_url exist
Note: if that db_url already has an equivalent connection pool, this doesn’t do anything
Sourcepub fn connect(&mut self, db_url: &str) -> Result<PooledConn, DbError>
pub fn connect(&mut self, db_url: &str) -> Result<PooledConn, DbError>
get a usable database connection from
Sourcepub fn dm(&mut self, db_url: &str) -> Result<DaoManager, DbError>
pub fn dm(&mut self, db_url: &str) -> Result<DaoManager, DbError>
returns a dao manager which provides api which data is already converted into Dao, Rows and Value
Sourcepub fn connect_mut(&mut self, db_url: &str) -> Result<PooledConn, DbError>
pub fn connect_mut(&mut self, db_url: &str) -> Result<PooledConn, DbError>
get a usable database connection from
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pool
impl !RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl !UnwindSafe for Pool
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