Skip to main content

IntoExpr

Trait IntoExpr 

Source
pub trait IntoExpr {
    type Sql: SqlType;
    type Req;

    // Required method
    fn into_expr(self) -> Expr<Self::Req, Self::Sql>;
}
Expand description

Converts a value into a typed expression, tagging it with the set of tables it references (Nil for a plain literal, Cons<T, Nil> for a bare column, or whatever Req an already-built Expr carries).

Required Associated Types§

Source

type Sql: SqlType

The SQL type this expression has. An associated type rather than a parameter because every implementor has exactly one — a column its declared type, a literal its leaf type — which is what lets a mismatch report itself as Comparable/AssignsTo rather than as an inference failure on a type nobody wrote.

Source

type Req

Required Methods§

Source

fn into_expr(self) -> Expr<Self::Req, Self::Sql>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoExpr for &String

Source§

impl IntoExpr for &str

Source§

impl IntoExpr for DateTime<Utc>

Source§

impl IntoExpr for Decimal

Source§

impl IntoExpr for NaiveDate

Source§

impl IntoExpr for String

Source§

impl IntoExpr for Uuid

Source§

impl IntoExpr for Vec<u8>

Source§

impl IntoExpr for bool

Source§

impl IntoExpr for f64

Source§

impl IntoExpr for i32

Source§

impl IntoExpr for i64

Implementors§

Source§

impl<C: ColumnKey> IntoExpr for Column<C>

Source§

type Sql = <C as ColumnKey>::Sql

Source§

type Req = Cons<<C as ColumnKey>::Table, Nil>

Source§

impl<K, Req, S: SqlType> IntoExpr for Keyed<K, Req, S>

Source§

type Sql = S

Source§

type Req = Req

Source§

impl<Req, S: SqlType> IntoExpr for Expr<Req, S>

Source§

type Sql = S

Source§

type Req = Req