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 AsExpression<Timestamptz> for now
impl<T: Expression> AsExpression<T::SqlType> for T
impl<'a> AsExpression<Date> for NaiveDate
impl<'a, 'expr> AsExpression<Date> for &'expr NaiveDate
impl<'a> AsExpression<Nullable<Date>> for NaiveDate
impl<'a, 'expr> AsExpression<Nullable<Date>> for &'expr NaiveDate
impl<'a> AsExpression<Time> for NaiveTime
impl<'a, 'expr> AsExpression<Time> for &'expr NaiveTime
impl<'a> AsExpression<Nullable<Time>> for NaiveTime
impl<'a, 'expr> AsExpression<Nullable<Time>> for &'expr NaiveTime
impl<'a> AsExpression<Timestamp> for NaiveDateTime
impl<'a, 'expr> AsExpression<Timestamp> for &'expr NaiveDateTime
impl<'a> AsExpression<Nullable<Timestamp>> for NaiveDateTime
impl<'a, 'expr> AsExpression<Nullable<Timestamp>> for &'expr NaiveDateTime
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, T: ?Sized, ST> AsExpression<ST> for Cow<'a, T> where
T: 'a + ToOwned,
Bound<ST, Cow<'a, T>>: Expression<SqlType = ST>,impl<'a, 'b, T: ?Sized, ST> AsExpression<ST> for &'b Cow<'a, T> where
T: 'a + ToOwned,
&'b T: AsExpression<ST>,impl<'a> AsExpression<Numeric> for BigDecimal
impl<'a, 'expr> AsExpression<Numeric> for &'expr BigDecimal
impl<'a> AsExpression<Nullable<Numeric>> for BigDecimal
impl<'a, 'expr> AsExpression<Nullable<Numeric>> for &'expr BigDecimal
impl<'a> AsExpression<Tinyint> for i8
impl<'a, 'expr> AsExpression<Tinyint> for &'expr i8
impl<'a> AsExpression<Nullable<Tinyint>> for i8
impl<'a, 'expr> AsExpression<Nullable<Tinyint>> for &'expr i8
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<Timestamptz> for NaiveDateTime
impl<'a, 'expr> AsExpression<Timestamptz> for &'expr NaiveDateTime
impl<'a> AsExpression<Nullable<Timestamptz>> for NaiveDateTime
impl<'a, 'expr> AsExpression<Nullable<Timestamptz>> for &'expr NaiveDateTime
impl<'a> AsExpression<Timestamptz> for DateTime<Utc>
impl<'a, 'expr> AsExpression<Timestamptz> for &'expr DateTime<Utc>
impl<'a> AsExpression<Nullable<Timestamptz>> for DateTime<Utc>
impl<'a, 'expr> AsExpression<Nullable<Timestamptz>> for &'expr DateTime<Utc>
impl<'a> AsExpression<Timestamptz> for DateTime<FixedOffset>
impl<'a, 'expr> AsExpression<Timestamptz> for &'expr DateTime<FixedOffset>
impl<'a> AsExpression<Nullable<Timestamptz>> for DateTime<FixedOffset>
impl<'a, 'expr> AsExpression<Nullable<Timestamptz>> for &'expr DateTime<FixedOffset>
impl<'a> AsExpression<Timestamptz> for DateTime<Local>
impl<'a, 'expr> AsExpression<Timestamptz> for &'expr DateTime<Local>
impl<'a> AsExpression<Nullable<Timestamptz>> for DateTime<Local>
impl<'a, 'expr> AsExpression<Nullable<Timestamptz>> for &'expr DateTime<Local>
impl<'a> AsExpression<Timestamp> for Timespec
impl<'a, 'expr> AsExpression<Timestamp> for &'expr Timespec
impl<'a> AsExpression<Nullable<Timestamp>> for Timespec
impl<'a, 'expr> AsExpression<Nullable<Timestamp>> for &'expr Timespec
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<MacAddr> for [u8; 6]
impl<'a, 'expr> AsExpression<MacAddr> for &'expr [u8; 6]
impl<'a> AsExpression<Nullable<MacAddr>> for [u8; 6]
impl<'a, 'expr> AsExpression<Nullable<MacAddr>> for &'expr [u8; 6]
impl<'a> AsExpression<Inet> for IpNetwork
impl<'a, 'expr> AsExpression<Inet> for &'expr IpNetwork
impl<'a> AsExpression<Nullable<Inet>> for IpNetwork
impl<'a, 'expr> AsExpression<Nullable<Inet>> for &'expr IpNetwork
impl<'a> AsExpression<Cidr> for IpNetwork
impl<'a, 'expr> AsExpression<Cidr> for &'expr IpNetwork
impl<'a> AsExpression<Nullable<Cidr>> for IpNetwork
impl<'a, 'expr> AsExpression<Nullable<Cidr>> for &'expr IpNetwork
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
impl<'a> AsExpression<Uuid> for Uuid
impl<'a, 'expr> AsExpression<Uuid> for &'expr Uuid
impl<'a> AsExpression<Nullable<Uuid>> for Uuid
impl<'a, 'expr> AsExpression<Nullable<Uuid>> for &'expr Uuid
impl<'a> AsExpression<Json> for Value
impl<'a, 'expr> AsExpression<Json> for &'expr Value
impl<'a> AsExpression<Nullable<Json>> for Value
impl<'a, 'expr> AsExpression<Nullable<Json>> for &'expr Value
impl<'a> AsExpression<Jsonb> for Value
impl<'a, 'expr> AsExpression<Jsonb> for &'expr Value
impl<'a> AsExpression<Nullable<Jsonb>> for Value
impl<'a, 'expr> AsExpression<Nullable<Jsonb>> for &'expr Value
impl<'a> AsExpression<Money> for PgMoney
impl<'a, 'expr> AsExpression<Money> for &'expr PgMoney
impl<'a> AsExpression<Nullable<Money>> for PgMoney
impl<'a, 'expr> AsExpression<Nullable<Money>> for &'expr PgMoney
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