Struct msi::Expr
[−]
[src]
pub struct Expr { /* fields omitted */ }
An expression on database rows that can be used in queries.
Methods
impl Expr
[src]
fn col(column_name: &str) -> Expr
Returns an expression that evaluates to the value of the specified column.
fn null() -> Expr
Returns an expression that evaluates to a null value.
fn boolean(boolean: bool) -> Expr
Returns an expression that evaluates to the given boolean value.
fn integer(integer: i32) -> Expr
Returns an expression that evaluates to the given integer value.
fn string(string: &str) -> Expr
Returns an expression that evaluates to the given string value.
fn eq(self, rhs: Expr) -> Expr
Returns an expression that evaluates to true if the two subexpressions evaluate to equal values.
fn ne(self, rhs: Expr) -> Expr
Returns an expression that evaluates to true if the two subexpressions evaluate to unequal values.
fn lt(self, rhs: Expr) -> Expr
Returns an expression that evaluates to true if the left-hand subexpression evaluates to a strictly lesser value than the right-hand subexpression.
fn le(self, rhs: Expr) -> Expr
Returns an expression that evaluates to true if the left-hand subexpression evaluates to a lesser-or-equal value than the right-hand subexpression.
fn gt(self, rhs: Expr) -> Expr
Returns an expression that evaluates to true if the left-hand subexpression evaluates to a strictly greater value than the right-hand subexpression.
fn ge(self, rhs: Expr) -> Expr
Returns an expression that evaluates to true if the left-hand subexpression evaluates to a greater-or-equal value than the right-hand subexpression.
fn bitinv(self) -> Expr
Returns an expression that computes the bitwise inverse of the subexpression. If the subexpression evaluates to a non-number, the result will be a null value.
This method exists instead of the std::ops::Not
trait to distinguish
it from the (logical) not()
method.
fn and(self, rhs: Expr) -> Expr
Returns an expression that evaluates to true if both subexpressions evaluate to true.
fn or(self, rhs: Expr) -> Expr
Returns an expression that evaluates to true if either subexpression evaluates to true.
fn not(self) -> Expr
Returns an expression that evaluates to true if the subexpression evaluates to false.
This method exists instead of the std::ops::Not
trait to distinguish
it from the (bitwise) bitinv()
method.
fn eval(&self, row: &Row) -> Value
Evaluates the expression against the given row. Any errors in the expression (such as dividing a number by zero, or applying a bitwise operator to a string) will result in a null value.
fn column_names(&self) -> HashSet<&str>
Returns the set of all column names referenced by this expression.
Trait Implementations
impl Neg for Expr
[src]
Produces an expression that evaluates to the negative of the subexpression. If the subexpression evaluates to a non-number, the result will be a null value.
type Output = Expr
The resulting type after applying the -
operator
fn neg(self) -> Expr
The method for the unary -
operator
impl Add for Expr
[src]
Produces an expression that evaluates to the sum of the two subexpressions (if they are integers) or concatenation (if they are strings). If the two subexpressions evaluate to different types, or if either evaluates to a null value, the result will be a null value.
type Output = Expr
The resulting type after applying the +
operator
fn add(self, rhs: Expr) -> Expr
The method for the +
operator
impl Sub for Expr
[src]
Produces an expression that evaluates to the difference of the two subexpressions. If either subexpression evaluates to a non-number, the result will be a null value.
type Output = Expr
The resulting type after applying the -
operator
fn sub(self, rhs: Expr) -> Expr
The method for the -
operator
impl Mul for Expr
[src]
Produces an expression that evaluates to the product of the two subexpressions. If either subexpression evaluates to a non-number, the result will be a null value.
type Output = Expr
The resulting type after applying the *
operator
fn mul(self, rhs: Expr) -> Expr
The method for the *
operator
impl Div for Expr
[src]
Produces an expression that evaluates to the integer quotient of the two subexpressions. If either subexpression evaluates to a non-number, or if the divisor evalulates to zero, the result will be a null value.
type Output = Expr
The resulting type after applying the /
operator
fn div(self, rhs: Expr) -> Expr
The method for the /
operator
impl BitAnd for Expr
[src]
Produces an expression that evaluates to the bitwise-and of the two subexpressions. If either subexpression evaluates to a non-number, the result will be a null value.
type Output = Expr
The resulting type after applying the &
operator
fn bitand(self, rhs: Expr) -> Expr
The method for the &
operator
impl BitOr for Expr
[src]
Produces an expression that evaluates to the bitwise-or of the two subexpressions. If either subexpression evaluates to a non-number, the result will be a null value.
type Output = Expr
The resulting type after applying the |
operator
fn bitor(self, rhs: Expr) -> Expr
The method for the |
operator
impl BitXor for Expr
[src]
Produces an expression that evaluates to the bitwise-xor of the two subexpressions. If either subexpression evaluates to a non-number, the result will be a null value.
type Output = Expr
The resulting type after applying the ^
operator
fn bitxor(self, rhs: Expr) -> Expr
The method for the ^
operator
impl Shl<Expr> for Expr
[src]
Produces an expression that evaluates to the value of the left-hand subexpression bit-shifted left by the value of the right-hand subexpression. If either subexpression evaluates to a non-number, the result will be a null value.
type Output = Expr
The resulting type after applying the <<
operator
fn shl(self, rhs: Expr) -> Expr
The method for the <<
operator
impl Shr<Expr> for Expr
[src]
Produces an expression that evaluates to the value of the left-hand subexpression bit-shifted right by the value of the right-hand subexpression. If either subexpression evaluates to a non-number, the result will be a null value.
type Output = Expr
The resulting type after applying the >>
operator
fn shr(self, rhs: Expr) -> Expr
The method for the >>
operator