Trait diesel::expression::AsExpression
[−]
[src]
pub trait AsExpression<T: NativeSqlType> { 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<'a, ST, T> AsExpression<Array<ST>> for &'a [T] where ST: NativeSqlType, T: ToSql<ST>
impl<ST, T> AsExpression<Array<ST>> for Vec<T> where ST: NativeSqlType, T: ToSql<ST>
impl<'a, ST, T> AsExpression<Array<ST>> for &'a Vec<T> where ST: NativeSqlType, T: ToSql<ST>
impl<'a> AsExpression<Date> for PgDate
impl<'a: 'expr, 'expr> AsExpression<Date> for &'expr PgDate
impl<'a> AsExpression<Nullable<Date>> for PgDate
impl<'a: 'expr, 'expr> AsExpression<Nullable<Date>> for &'a PgDate
impl<'a> AsExpression<Interval> for PgInterval
impl<'a: 'expr, 'expr> AsExpression<Interval> for &'expr PgInterval
impl<'a> AsExpression<Nullable<Interval>> for PgInterval
impl<'a: 'expr, 'expr> AsExpression<Nullable<Interval>> for &'a PgInterval
impl<'a> AsExpression<Time> for PgTime
impl<'a: 'expr, 'expr> AsExpression<Time> for &'expr PgTime
impl<'a> AsExpression<Nullable<Time>> for PgTime
impl<'a: 'expr, 'expr> AsExpression<Nullable<Time>> for &'a PgTime
impl<'a> AsExpression<Timestamp> for PgTimestamp
impl<'a: 'expr, 'expr> AsExpression<Timestamp> for &'expr PgTimestamp
impl<'a> AsExpression<Nullable<Timestamp>> for PgTimestamp
impl<'a: 'expr, 'expr> AsExpression<Nullable<Timestamp>> for &'a PgTimestamp
impl<T, ST> AsExpression<Nullable<ST>> for Option<T> where Option<T>: ToSql<Nullable<ST>>, ST: NativeSqlType
impl<'a, T, ST> AsExpression<Nullable<ST>> for &'a Option<T> where Option<T>: ToSql<Nullable<ST>>, ST: NativeSqlType
impl<'a> AsExpression<Bool> for bool
impl<'a: 'expr, 'expr> AsExpression<Bool> for &'expr bool
impl<'a> AsExpression<Nullable<Bool>> for bool
impl<'a: 'expr, 'expr> AsExpression<Nullable<Bool>> for &'a bool
impl<'a> AsExpression<SmallInt> for i16
impl<'a: 'expr, 'expr> AsExpression<SmallInt> for &'expr i16
impl<'a> AsExpression<Nullable<SmallInt>> for i16
impl<'a: 'expr, 'expr> AsExpression<Nullable<SmallInt>> for &'a i16
impl<'a> AsExpression<Integer> for i32
impl<'a: 'expr, 'expr> AsExpression<Integer> for &'expr i32
impl<'a> AsExpression<Nullable<Integer>> for i32
impl<'a: 'expr, 'expr> AsExpression<Nullable<Integer>> for &'a i32
impl<'a> AsExpression<BigInt> for i64
impl<'a: 'expr, 'expr> AsExpression<BigInt> for &'expr i64
impl<'a> AsExpression<Nullable<BigInt>> for i64
impl<'a: 'expr, 'expr> AsExpression<Nullable<BigInt>> for &'a i64
impl<'a> AsExpression<Oid> for u32
impl<'a: 'expr, 'expr> AsExpression<Oid> for &'expr u32
impl<'a> AsExpression<Nullable<Oid>> for u32
impl<'a: 'expr, 'expr> AsExpression<Nullable<Oid>> for &'a u32
impl<'a> AsExpression<Float> for f32
impl<'a: 'expr, 'expr> AsExpression<Float> for &'expr f32
impl<'a> AsExpression<Nullable<Float>> for f32
impl<'a: 'expr, 'expr> AsExpression<Nullable<Float>> for &'a f32
impl<'a> AsExpression<Double> for f64
impl<'a: 'expr, 'expr> AsExpression<Double> for &'expr f64
impl<'a> AsExpression<Nullable<Double>> for f64
impl<'a: 'expr, 'expr> AsExpression<Nullable<Double>> for &'a f64
impl<'a> AsExpression<Numeric> for PgNumeric
impl<'a: 'expr, 'expr> AsExpression<Numeric> for &'expr PgNumeric
impl<'a> AsExpression<Nullable<Numeric>> for PgNumeric
impl<'a: 'expr, 'expr> AsExpression<Nullable<Numeric>> for &'a PgNumeric
impl<'a> AsExpression<VarChar> for String
impl<'a: 'expr, 'expr> AsExpression<VarChar> for &'expr String
impl<'a> AsExpression<Nullable<VarChar>> for String
impl<'a: 'expr, 'expr> AsExpression<Nullable<VarChar>> for &'a String
impl<'a> AsExpression<Text> for String
impl<'a: 'expr, 'expr> AsExpression<Text> for &'expr String
impl<'a> AsExpression<Nullable<Text>> for String
impl<'a: 'expr, 'expr> AsExpression<Nullable<Text>> for &'a String
impl<'a> AsExpression<Binary> for Vec<u8>
impl<'a: 'expr, 'expr> AsExpression<Binary> for &'expr Vec<u8>
impl<'a> AsExpression<Nullable<Binary>> for Vec<u8>
impl<'a: 'expr, 'expr> AsExpression<Nullable<Binary>> for &'a Vec<u8>
impl<'a> AsExpression<VarChar> for &'a str
impl<'a: 'expr, 'expr> AsExpression<VarChar> for &'expr &'a str
impl<'a> AsExpression<Nullable<VarChar>> for &'a str
impl<'a: 'expr, 'expr> AsExpression<Nullable<VarChar>> for &'a &'a str
impl<'a> AsExpression<Text> for &'a str
impl<'a: 'expr, 'expr> AsExpression<Text> for &'expr &'a str
impl<'a> AsExpression<Nullable<Text>> for &'a str
impl<'a: 'expr, 'expr> AsExpression<Nullable<Text>> for &'a &'a str
impl<'a> AsExpression<Binary> for &'a [u8]
impl<'a: 'expr, 'expr> AsExpression<Binary> for &'expr &'a [u8]
impl<'a> AsExpression<Nullable<Binary>> for &'a [u8]
impl<'a: 'expr, 'expr> AsExpression<Nullable<Binary>> for &'a &'a [u8]