pub struct DB;
Implementations§
Source§impl DB
impl DB
Sourcepub fn init_pool() -> Result<(), Box<dyn Error>>
pub fn init_pool() -> Result<(), Box<dyn Error>>
Initialize the global pool with optional overrides.
§Errors
Returns an error if the pool cannot be created, or if the pool is already initialized.
Sourcepub fn get_conn() -> Result<PooledConnection<ConnectionManager<MysqlConnection>>, String>
pub fn get_conn() -> Result<PooledConnection<ConnectionManager<MysqlConnection>>, String>
Retrieve a pooled connection.
§Returns
A PooledConnection
if successful, or an error if the pool is not initialized
or cannot allocate a new connection.
Auto Trait Implementations§
impl Freeze for DB
impl RefUnwindSafe for DB
impl Send for DB
impl Sync for DB
impl Unpin for DB
impl UnwindSafe for DB
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> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more