pub trait ComparisonOperand<'a, V, L>: Sized{
type SQLType: DataType;
type Aggregate: AggregateKind;
// Required method
fn into_comparison_sql(self) -> SQL<'a, V>;
}Expand description
Type-safe operand for comparison functions.
This trait exists as an indirection layer between comparison functions
(eq, gt, like, etc.) and the Expr trait. Rather than accepting
any Expr directly, comparisons require ComparisonOperand<'a, V, L>
where L is the left-hand expression type.
The blanket impl below only fires when L::SQLType: Compatible<R::SQLType>.
Table macros can also implement this trait for custom column value types and
a specific generated column ZST, which enables eq(table.custom, value)
without making the value type a global SQL expression.
Required Associated Types§
Required Methods§
fn into_comparison_sql(self) -> SQL<'a, V>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".