pub enum SourcePredicate {
Eq(String, PropertyValue),
Neq(String, PropertyValue),
Gt(String, PropertyValue),
Gte(String, PropertyValue),
Lt(String, PropertyValue),
Lte(String, PropertyValue),
Between(String, PropertyValue, PropertyValue),
HasKey(String),
StartsWith(String, String),
And(Vec<SourcePredicate>),
Or(Vec<SourcePredicate>),
}Expand description
A predicate that can be used in source steps (n_where / e_where).
This is a restricted subset of Predicate intended to be index- and
planner-friendly for “source” selection.
Variants§
Eq(String, PropertyValue)
Equals: property == value
Neq(String, PropertyValue)
Not equals: property != value
Gt(String, PropertyValue)
Greater than: property > value (for numeric/string)
Gte(String, PropertyValue)
Greater than or equal: property >= value
Lt(String, PropertyValue)
Less than: property < value
Lte(String, PropertyValue)
Less than or equal: property <= value
Between(String, PropertyValue, PropertyValue)
Between (inclusive): min <= property <= max
HasKey(String)
Property exists
StartsWith(String, String)
String starts with prefix
And(Vec<SourcePredicate>)
Logical AND of predicates
Or(Vec<SourcePredicate>)
Logical OR of predicates
Implementations§
Source§impl SourcePredicate
impl SourcePredicate
Sourcepub fn eq(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
pub fn eq(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
Create an equality predicate
Sourcepub fn neq(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
pub fn neq(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
Create a not-equals predicate
Sourcepub fn gt(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
pub fn gt(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
Create a greater-than predicate
Sourcepub fn gte(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
pub fn gte(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
Create a greater-than-or-equal predicate
Sourcepub fn lt(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
pub fn lt(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
Create a less-than predicate
Sourcepub fn lte(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
pub fn lte(property: impl Into<String>, value: impl Into<PropertyValue>) -> Self
Create a less-than-or-equal predicate
Sourcepub fn between(
property: impl Into<String>,
min: impl Into<PropertyValue>,
max: impl Into<PropertyValue>,
) -> Self
pub fn between( property: impl Into<String>, min: impl Into<PropertyValue>, max: impl Into<PropertyValue>, ) -> Self
Create a between predicate (inclusive)
Sourcepub fn starts_with(
property: impl Into<String>,
prefix: impl Into<String>,
) -> Self
pub fn starts_with( property: impl Into<String>, prefix: impl Into<String>, ) -> Self
Create a starts-with predicate
Sourcepub fn and(predicates: Vec<SourcePredicate>) -> Self
pub fn and(predicates: Vec<SourcePredicate>) -> Self
Combine predicates with AND
Sourcepub fn or(predicates: Vec<SourcePredicate>) -> Self
pub fn or(predicates: Vec<SourcePredicate>) -> Self
Combine predicates with OR
Trait Implementations§
Source§impl Clone for SourcePredicate
impl Clone for SourcePredicate
Source§fn clone(&self) -> SourcePredicate
fn clone(&self) -> SourcePredicate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more