pub struct Database<C>where
C: Connection + 'static,{ /* private fields */ }Implementations§
Source§impl<C> Database<C>where
C: Connection,
impl<C> Database<C>where
C: Connection,
pub fn open(url: impl Into<String>) -> Database<C>
pub fn builder() -> Builder<C>
Sourcepub fn transaction<F, R, E>(
&self,
f: F,
) -> impl Future<Item = R, Error = AsyncError<E>>
pub fn transaction<F, R, E>( &self, f: F, ) -> impl Future<Item = R, Error = AsyncError<E>>
Executes the given function inside a database transaction.
Sourcepub fn get<F, R, E>(&self, f: F) -> impl Future<Item = R, Error = AsyncError<E>>
pub fn get<F, R, E>(&self, f: F) -> impl Future<Item = R, Error = AsyncError<E>>
Executes the given function with a connection retrieved from the pool.
This is non-blocking and uses a SyncArbiter to provide a thread pool.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Database<C>
impl<C> !RefUnwindSafe for Database<C>
impl<C> Send for Database<C>
impl<C> Sync for Database<C>
impl<C> Unpin for Database<C>
impl<C> !UnwindSafe for Database<C>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read more