pub trait ComparisonOperand<'a, V, Expected>{
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, Expected>
where Expected is the left-hand side’s SQL type.
The blanket impl below only fires when Expected: Compatible<R::SQLType>,
so passing an incompatible type (e.g. comparing Int with Text) fails
at compile time with a clear diagnostic.
Required Associated Types§
Required Methods§
fn into_comparison_sql(self) -> SQL<'a, V>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".