pub enum RuleCondition {
Equals {
field: String,
value: String,
},
NotEquals {
field: String,
value: String,
},
GreaterThan {
field: String,
value: f64,
},
LessThan {
field: String,
value: f64,
},
Matches {
field: String,
pattern: String,
},
Exists {
field: String,
},
In {
field: String,
values: Vec<String>,
},
TimeCondition {
field: String,
operator: TimeOperator,
value: DateTime<Utc>,
},
And {
conditions: Vec<RuleCondition>,
},
Or {
conditions: Vec<RuleCondition>,
},
Not {
condition: Box<RuleCondition>,
},
Custom {
condition_type: String,
parameters: HashMap<String, String>,
},
}Expand description
Rule condition definition
Variants§
Equals
Simple equality check
NotEquals
Inequality check
GreaterThan
Greater than comparison
LessThan
Less than comparison
Matches
Pattern matching with regex
Exists
Field existence check
In
Value in list check
TimeCondition
Time-based condition
And
Complex logical condition
Fields
§
conditions: Vec<RuleCondition>Or
Complex logical condition
Fields
§
conditions: Vec<RuleCondition>Not
Negation condition
Fields
§
condition: Box<RuleCondition>Custom
Custom condition with parameters
Implementations§
Trait Implementations§
Source§impl Clone for RuleCondition
impl Clone for RuleCondition
Source§fn clone(&self) -> RuleCondition
fn clone(&self) -> RuleCondition
Returns a duplicate 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 Debug for RuleCondition
impl Debug for RuleCondition
Source§impl<'de> Deserialize<'de> for RuleCondition
impl<'de> Deserialize<'de> for RuleCondition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RuleCondition
impl RefUnwindSafe for RuleCondition
impl Send for RuleCondition
impl Sync for RuleCondition
impl Unpin for RuleCondition
impl UnwindSafe for RuleCondition
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