pub struct Expression<'a> { /* private fields */ }
Expand description
An expression that can be positioned in a query. Can be a single value or a statement that is evaluated into a value.
Implementations§
Source§impl<'a> Expression<'a>
impl<'a> Expression<'a>
Sourcepub fn kind(&self) -> &ExpressionKind<'a>
pub fn kind(&self) -> &ExpressionKind<'a>
The type of the expression, dictates how it’s implemented in the query.
Trait Implementations§
Source§impl<'a> Add for Expression<'a>
impl<'a> Add for Expression<'a>
Source§impl<'a> Aliasable<'a> for Expression<'a>
impl<'a> Aliasable<'a> for Expression<'a>
Source§impl<'a> Clone for Expression<'a>
impl<'a> Clone for Expression<'a>
Source§fn clone(&self) -> Expression<'a>
fn clone(&self) -> Expression<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Comparable<'a> for Expression<'a>
impl<'a> Comparable<'a> for Expression<'a>
Source§fn equals<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn equals<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if both sides are the same value.
Source§fn not_equals<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn not_equals<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if both sides are not the same value.
Source§fn less_than<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn less_than<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the left side is smaller than the right side.
Source§fn less_than_or_equals<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn less_than_or_equals<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the left side is smaller than the right side or the same.
Source§fn greater_than<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn greater_than<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the left side is bigger than the right side.
Source§fn greater_than_or_equals<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn greater_than_or_equals<T>(self, comparison: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the left side is bigger than the right side or the same.
Source§fn in_selection<T>(self, selection: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn in_selection<T>(self, selection: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the left side is included in the right side collection.
Source§fn not_in_selection<T>(self, selection: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn not_in_selection<T>(self, selection: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the left side is not included in the right side collection.
Source§fn like<T>(self, pattern: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn like<T>(self, pattern: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the left side includes the right side string.
Source§fn not_like<T>(self, pattern: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn not_like<T>(self, pattern: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the left side does not include the right side string.
Source§fn is_not_null(self) -> Compare<'a>
fn is_not_null(self) -> Compare<'a>
Tests if the left side is not
NULL
.Source§fn between<T, V>(self, left: T, right: V) -> Compare<'a>
fn between<T, V>(self, left: T, right: V) -> Compare<'a>
Tests if the value is between two given values.
Source§fn not_between<T, V>(self, left: T, right: V) -> Compare<'a>
fn not_between<T, V>(self, left: T, right: V) -> Compare<'a>
Tests if the value is not between two given values.
Source§fn compare_raw<T, V>(self, raw_comparator: T, right: V) -> Compare<'a>
fn compare_raw<T, V>(self, raw_comparator: T, right: V) -> Compare<'a>
Compares two expressions with a custom operator.
Source§fn array_contains<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn array_contains<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the array contains another array.
Source§fn array_contained<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn array_contained<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the JSON array contains a value.
Source§fn array_overlaps<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn array_overlaps<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the array overlaps with another array.
Source§fn json_array_not_contains<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn json_array_not_contains<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the JSON array does not contain a value.
Source§fn json_array_begins_with<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn json_array_begins_with<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the JSON array starts with a value.
Source§fn json_array_not_begins_with<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn json_array_not_begins_with<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the JSON array does not start with a value.
Source§fn json_array_ends_into<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn json_array_ends_into<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the JSON array ends with a value.
Source§fn json_array_not_ends_into<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
fn json_array_not_ends_into<T>(self, item: T) -> Compare<'a>where
T: Into<Expression<'a>>,
Tests if the JSON array does not end with a value.
Source§fn json_type_equals<T>(self, json_type: T) -> Compare<'a>
fn json_type_equals<T>(self, json_type: T) -> Compare<'a>
Tests if the JSON value is of a certain type.
Source§fn json_type_not_equals<T>(self, json_type: T) -> Compare<'a>
fn json_type_not_equals<T>(self, json_type: T) -> Compare<'a>
Tests if the JSON value is not of a certain type.
Source§impl<'a> Debug for Expression<'a>
impl<'a> Debug for Expression<'a>
Source§impl<'a> Div for Expression<'a>
impl<'a> Div for Expression<'a>
Source§impl<'a> From<Column<'a>> for Expression<'a>
impl<'a> From<Column<'a>> for Expression<'a>
Source§impl<'a> From<Compare<'a>> for Expression<'a>
impl<'a> From<Compare<'a>> for Expression<'a>
Source§impl<'a> From<ConditionTree<'a>> for Expression<'a>
impl<'a> From<ConditionTree<'a>> for Expression<'a>
Source§fn from(ct: ConditionTree<'a>) -> Self
fn from(ct: ConditionTree<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<ExpressionKind<'a>> for Expression<'a>
impl<'a> From<ExpressionKind<'a>> for Expression<'a>
Source§fn from(kind: ExpressionKind<'a>) -> Self
fn from(kind: ExpressionKind<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<Function<'a>> for Expression<'a>
impl<'a> From<Function<'a>> for Expression<'a>
Source§impl<'a> From<Row<'a>> for Expression<'a>
impl<'a> From<Row<'a>> for Expression<'a>
Source§impl<'a> From<Select<'a>> for Expression<'a>
impl<'a> From<Select<'a>> for Expression<'a>
Source§fn from(sel: Select<'a>) -> Expression<'a>
fn from(sel: Select<'a>) -> Expression<'a>
Converts to this type from the input type.
Source§impl<'a> From<SqlOp<'a>> for Expression<'a>
impl<'a> From<SqlOp<'a>> for Expression<'a>
Source§impl<'a, T> From<T> for Expression<'a>
impl<'a, T> From<T> for Expression<'a>
Source§impl<'a> From<Table<'a>> for Expression<'a>
impl<'a> From<Table<'a>> for Expression<'a>
Source§impl<'a> From<Values<'a>> for Expression<'a>
impl<'a> From<Values<'a>> for Expression<'a>
Source§impl<'a> Mul for Expression<'a>
impl<'a> Mul for Expression<'a>
Source§impl<'a> PartialEq for Expression<'a>
impl<'a> PartialEq for Expression<'a>
Source§impl<'a> Rem for Expression<'a>
impl<'a> Rem for Expression<'a>
Source§impl<'a> Sub for Expression<'a>
impl<'a> Sub for Expression<'a>
impl<'a> StructuralPartialEq for Expression<'a>
Auto Trait Implementations§
impl<'a> Freeze for Expression<'a>
impl<'a> RefUnwindSafe for Expression<'a>
impl<'a> Send for Expression<'a>
impl<'a> Sync for Expression<'a>
impl<'a> Unpin for Expression<'a>
impl<'a> UnwindSafe for Expression<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> Conjunctive<'a> for Twhere
T: Into<Expression<'a>>,
impl<'a, T> Conjunctive<'a> for Twhere
T: Into<Expression<'a>>,
Source§fn and<E>(self, other: E) -> ConditionTree<'a>where
E: Into<Expression<'a>>,
fn and<E>(self, other: E) -> ConditionTree<'a>where
E: Into<Expression<'a>>,
Builds an
AND
condition having self
as the left leaf and other
as the right.Source§fn or<E>(self, other: E) -> ConditionTree<'a>where
E: Into<Expression<'a>>,
fn or<E>(self, other: E) -> ConditionTree<'a>where
E: Into<Expression<'a>>,
Builds an
OR
condition having self
as the left leaf and other
as the right.Source§fn not(self) -> ConditionTree<'a>
fn not(self) -> ConditionTree<'a>
Builds a
NOT
condition having self
as the condition.