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> AsExpression<Date> for String
impl<'a, 'expr> AsExpression<Date> for &'expr String
impl<'a> AsExpression<Nullable<Date>> for String
impl<'a, 'expr> AsExpression<Nullable<Date>> for &'expr String
impl<'a> AsExpression<Date> for &'a str
impl<'a, 'expr> AsExpression<Date> for &'expr &'a str
impl<'a> AsExpression<Nullable<Date>> for &'a str
impl<'a, 'expr> AsExpression<Nullable<Date>> for &'expr &'a str
impl<'a> AsExpression<Time> for String
impl<'a, 'expr> AsExpression<Time> for &'expr String
impl<'a> AsExpression<Nullable<Time>> for String
impl<'a, 'expr> AsExpression<Nullable<Time>> for &'expr String
impl<'a> AsExpression<Time> for &'a str
impl<'a, 'expr> AsExpression<Time> for &'expr &'a str
impl<'a> AsExpression<Nullable<Time>> for &'a str
impl<'a, 'expr> AsExpression<Nullable<Time>> for &'expr &'a str
impl<'a> AsExpression<Timestamp> for String
impl<'a, 'expr> AsExpression<Timestamp> for &'expr String
impl<'a> AsExpression<Nullable<Timestamp>> for String
impl<'a, 'expr> AsExpression<Nullable<Timestamp>> for &'expr String
impl<'a> AsExpression<Timestamp> for &'a str
impl<'a, 'expr> AsExpression<Timestamp> for &'expr &'a str
impl<'a> AsExpression<Nullable<Timestamp>> for &'a str
impl<'a, 'expr> AsExpression<Nullable<Timestamp>> for &'expr &'a str