Trait diesel::expression::AsExpression
[−]
[src]
pub trait AsExpression<T> { type Expression: Expression<SqlType=T>; fn as_expression(self) -> Self::Expression; }
Describes how a type can be represented as an expression for a given type.
These types couldn't just implement Expression
directly, as many things can be used as an expression of multiple types.
(String
for example, can be used as either
VarChar
or
Text
).
This trait allows us to use primitives on the right hand side of various
expressions. For example name.eq("Sean")
Associated Types
type Expression: Expression<SqlType=T>
Required Methods
fn as_expression(self) -> Self::Expression
Implementors
impl<T: Expression> AsExpression<T::SqlType> for T
impl<T, ST> AsExpression<Nullable<ST>> for Option<T> where ST: NotNull
impl<'a, T, ST> AsExpression<Nullable<ST>> for &'a Option<T> where ST: NotNull
impl<'a> AsExpression<Bool> for bool
impl<'a, 'expr> AsExpression<Bool> for &'expr bool
impl<'a> AsExpression<Nullable<Bool>> for bool
impl<'a, 'expr> AsExpression<Nullable<Bool>> for &'expr bool
impl<'a> AsExpression<SmallInt> for i16
impl<'a, 'expr> AsExpression<SmallInt> for &'expr i16
impl<'a> AsExpression<Nullable<SmallInt>> for i16
impl<'a, 'expr> AsExpression<Nullable<SmallInt>> for &'expr i16
impl<'a> AsExpression<Integer> for i32
impl<'a, 'expr> AsExpression<Integer> for &'expr i32
impl<'a> AsExpression<Nullable<Integer>> for i32
impl<'a, 'expr> AsExpression<Nullable<Integer>> for &'expr i32
impl<'a> AsExpression<BigInt> for i64
impl<'a, 'expr> AsExpression<BigInt> for &'expr i64
impl<'a> AsExpression<Nullable<BigInt>> for i64
impl<'a, 'expr> AsExpression<Nullable<BigInt>> for &'expr i64
impl<'a> AsExpression<Float> for f32
impl<'a, 'expr> AsExpression<Float> for &'expr f32
impl<'a> AsExpression<Nullable<Float>> for f32
impl<'a, 'expr> AsExpression<Nullable<Float>> for &'expr f32
impl<'a> AsExpression<Double> for f64
impl<'a, 'expr> AsExpression<Double> for &'expr f64
impl<'a> AsExpression<Nullable<Double>> for f64
impl<'a, 'expr> AsExpression<Nullable<Double>> for &'expr f64
impl<'a> AsExpression<Text> for String
impl<'a, 'expr> AsExpression<Text> for &'expr String
impl<'a> AsExpression<Nullable<Text>> for String
impl<'a, 'expr> AsExpression<Nullable<Text>> for &'expr String
impl<'a> AsExpression<Binary> for Vec<u8>
impl<'a, 'expr> AsExpression<Binary> for &'expr Vec<u8>
impl<'a> AsExpression<Nullable<Binary>> for Vec<u8>
impl<'a, 'expr> AsExpression<Nullable<Binary>> for &'expr Vec<u8>
impl<'a> AsExpression<Text> for &'a str
impl<'a, 'expr> AsExpression<Text> for &'expr &'a str
impl<'a> AsExpression<Nullable<Text>> for &'a str
impl<'a, 'expr> AsExpression<Nullable<Text>> for &'expr &'a str
impl<'a> AsExpression<Binary> for &'a [u8]
impl<'a, 'expr> AsExpression<Binary> for &'expr &'a [u8]
impl<'a> AsExpression<Nullable<Binary>> for &'a [u8]
impl<'a, 'expr> AsExpression<Nullable<Binary>> for &'expr &'a [u8]
impl<'a, 'b, ST, T> AsExpression<Array<ST>> for &'a [T] where Pg: HasSqlType<ST>
impl<'a, 'b, ST, T> AsExpression<Nullable<Array<ST>>> for &'a [T] where Pg: HasSqlType<ST>
impl<'a, 'b, ST, T> AsExpression<Array<ST>> for &'a &'b [T] where Pg: HasSqlType<ST>
impl<'a, 'b, ST, T> AsExpression<Nullable<Array<ST>>> for &'a &'b [T] where Pg: HasSqlType<ST>
impl<'a, 'b, ST, T> AsExpression<Array<ST>> for Vec<T> where Pg: HasSqlType<ST>
impl<'a, 'b, ST, T> AsExpression<Nullable<Array<ST>>> for Vec<T> where Pg: HasSqlType<ST>
impl<'a, 'b, ST, T> AsExpression<Array<ST>> for &'a Vec<T> where Pg: HasSqlType<ST>
impl<'a, 'b, ST, T> AsExpression<Nullable<Array<ST>>> for &'a Vec<T> where Pg: HasSqlType<ST>
impl<'a> AsExpression<Timestamp> for SystemTime
impl<'a, 'expr> AsExpression<Timestamp> for &'expr SystemTime
impl<'a> AsExpression<Nullable<Timestamp>> for SystemTime
impl<'a, 'expr> AsExpression<Nullable<Timestamp>> for &'expr SystemTime
impl<'a> AsExpression<Date> for PgDate
impl<'a, 'expr> AsExpression<Date> for &'expr PgDate
impl<'a> AsExpression<Nullable<Date>> for PgDate
impl<'a, 'expr> AsExpression<Nullable<Date>> for &'expr PgDate
impl<'a> AsExpression<Time> for PgTime
impl<'a, 'expr> AsExpression<Time> for &'expr PgTime
impl<'a> AsExpression<Nullable<Time>> for PgTime
impl<'a, 'expr> AsExpression<Nullable<Time>> for &'expr PgTime
impl<'a> AsExpression<Timestamp> for PgTimestamp
impl<'a, 'expr> AsExpression<Timestamp> for &'expr PgTimestamp
impl<'a> AsExpression<Nullable<Timestamp>> for PgTimestamp
impl<'a, 'expr> AsExpression<Nullable<Timestamp>> for &'expr PgTimestamp
impl<'a> AsExpression<Timestamptz> for PgTimestamp
impl<'a, 'expr> AsExpression<Timestamptz> for &'expr PgTimestamp
impl<'a> AsExpression<Nullable<Timestamptz>> for PgTimestamp
impl<'a, 'expr> AsExpression<Nullable<Timestamptz>> for &'expr PgTimestamp
impl<'a> AsExpression<Interval> for PgInterval
impl<'a, 'expr> AsExpression<Interval> for &'expr PgInterval
impl<'a> AsExpression<Nullable<Interval>> for PgInterval
impl<'a, 'expr> AsExpression<Nullable<Interval>> for &'expr PgInterval
impl<'a> AsExpression<Oid> for u32
impl<'a, 'expr> AsExpression<Oid> for &'expr u32
impl<'a> AsExpression<Nullable<Oid>> for u32
impl<'a, 'expr> AsExpression<Nullable<Oid>> for &'expr u32
impl<'a> AsExpression<Numeric> for PgNumeric
impl<'a, 'expr> AsExpression<Numeric> for &'expr PgNumeric
impl<'a> AsExpression<Nullable<Numeric>> for PgNumeric
impl<'a, 'expr> AsExpression<Nullable<Numeric>> for &'expr PgNumeric