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