pub struct Db<'a>(_);
Expand description
Opaque wrapper around a database connection.
Useful for model functions like [models::user::User::by_email
].
Implementations§
Trait Implementations§
source§impl<'a> From<&'a PgConnection> for Db<'a>
impl<'a> From<&'a PgConnection> for Db<'a>
source§fn from(o: &'a PgConnection) -> Self
fn from(o: &'a PgConnection) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Db<'a>
impl<'a> !Send for Db<'a>
impl<'a> !Sync for Db<'a>
impl<'a> Unpin for Db<'a>
impl<'a> !UnwindSafe for Db<'a>
Blanket Implementations§
§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
§fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
Converts
self
into a collection.fn mapped<U, F, A>(self, f: F) -> SmallVec<A>where
F: FnMut(T) -> U,
A: Array<Item = U>,
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
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