1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use expression::grouped::Grouped;
use expression::predicates::{And, Or};
use expression::{Expression, AsExpression};
use types::Bool;
pub trait BoolExpressionMethods: Expression<SqlType=Bool> + Sized {
fn and<T: AsExpression<Bool>>(self, other: T) -> And<Self, T::Expression> {
And::new(self.as_expression(), other.as_expression())
}
fn or<T: AsExpression<Bool>>(self, other: T) -> Grouped<Or<Self, T::Expression>> {
Grouped(Or::new(self, other.as_expression()))
}
}
impl<T: Expression<SqlType=Bool>> BoolExpressionMethods for T {}