Skip to main content

ComparisonOperand

Trait ComparisonOperand 

Source
pub trait ComparisonOperand<'a, V, L>: Sized
where V: SQLParam + 'a, L: Expr<'a, V>,
{ type SQLType: DataType; type Nullable: Nullability; type Aggregate: AggregateKind; type Sources; // Required method fn into_comparison_sql(self) -> SQL<'a, V>; }
Expand description

A value that can be the right-hand side of a comparison with L.

Every Expr whose SQL type is compatible with L’s is an operand. The table macros also implement this trait for a column’s custom Rust type (such as an enum or JSON struct) against that one column, so eq(table.custom, value) works without making the custom type an expression everywhere.

Required Associated Types§

Source

type SQLType: DataType

SQL type of the operand.

Source

type Nullable: Nullability

Whether the operand can be NULL.

Source

type Aggregate: AggregateKind

Whether the operand is an aggregate.

Source

type Sources

Tables the operand reads; see ExprSources::Sources.

Required Methods§

Source

fn into_comparison_sql(self) -> SQL<'a, V>

Renders the operand.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<'a, V, L, R> ComparisonOperand<'a, V, L> for R
where V: SQLParam + 'a, L: Expr<'a, V>, R: Expr<'a, V>, L::SQLType: Compatible<R::SQLType>,

Source§

type SQLType = <R as Expr<'a, V>>::SQLType

Source§

type Nullable = <R as Expr<'a, V>>::Nullable

Source§

type Aggregate = <R as Expr<'a, V>>::Aggregate

Source§

type Sources = <R as ExprSources>::Sources