pub trait ExprMethods: IntoExpr + Sized {
// Provided methods
fn eq<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>,
Self::Req: Concat<Rhs::Req> { ... }
fn ne<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>,
Self::Req: Concat<Rhs::Req> { ... }
fn lt<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>,
Self::Req: Concat<Rhs::Req> { ... }
fn lte<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>,
Self::Req: Concat<Rhs::Req> { ... }
fn gt<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>,
Self::Req: Concat<Rhs::Req> { ... }
fn gte<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>,
Self::Req: Concat<Rhs::Req> { ... }
fn is_null(self) -> Expr<Self::Req, Bool> { ... }
fn is_not_null(self) -> Expr<Self::Req, Bool> { ... }
fn and<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: BoolLike,
Rhs::Sql: BoolLike,
Self::Req: Concat<Rhs::Req> { ... }
fn or<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: BoolLike,
Rhs::Sql: BoolLike,
Self::Req: Concat<Rhs::Req> { ... }
fn like<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: TextLike,
Rhs::Sql: TextLike,
Self::Req: Concat<Rhs::Req> { ... }
fn is_in<I>(self, values: I) -> Expr<Self::Req, Bool>
where I: IntoIterator,
I::Item: IntoExpr<Req = Nil>,
Self::Sql: Comparable<<I::Item as IntoExpr>::Sql> { ... }
}Expand description
Comparison/boolean-combinator methods, blanket-implemented for anything
convertible to a typed expression (columns, literals, and Expr itself).
Kept separate from IntoExpr so one blanket impl can serve all three.
Provided Methods§
fn eq<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
fn ne<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
fn lt<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
fn lte<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
fn gt<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
fn gte<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
Sourcefn is_null(self) -> Expr<Self::Req, Bool>
fn is_null(self) -> Expr<Self::Req, Bool>
x IS NULL. Not expressible as .eq(..): comparing to NULL with =
yields NULL, never true, so the two are different questions.
fn is_not_null(self) -> Expr<Self::Req, Bool>
Sourcefn and<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
fn and<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
a AND b. The boolean requirement is on the method rather than on
the receiver’s type, so every spelling a condition has — a
comparison, a sql! fragment, a Nullable<Bool> column — combines
with every other, the way .filter accepts them all.
Sourcefn or<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
fn or<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
a OR b — see and.
Sourcefn like<Rhs: IntoExpr>(
self,
rhs: Rhs,
) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
fn like<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
x LIKE 'pattern'. The text requirement is on the method rather
than on a trait of its own, so a non-text operand reports TextLike
instead of a missing method.
Sourcefn is_in<I>(self, values: I) -> Expr<Self::Req, Bool>where
I: IntoIterator,
I::Item: IntoExpr<Req = Nil>,
Self::Sql: Comparable<<I::Item as IntoExpr>::Sql>,
fn is_in<I>(self, values: I) -> Expr<Self::Req, Bool>where
I: IntoIterator,
I::Item: IntoExpr<Req = Nil>,
Self::Sql: Comparable<<I::Item as IntoExpr>::Sql>,
x IN (a, b, ..) over a runtime-length list of literals, each bound
as its own parameter. An empty list renders FALSE.
Known limitation: the list holds values, not expressions — a
column reference on the right needs the table it belongs to folded
into Req, which is the same design sql!{} covers today.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".