#[non_exhaustive]pub enum RuleKind {
Required,
Range {
min: Option<f64>,
max: Option<f64>,
},
Matches(String),
Text {
comparison: TextComparison,
text: String,
ignore_case: bool,
},
Compare {
comparison: Comparison,
with: Operand,
},
Criteria(String),
IsTrue,
Unique,
UniqueTogether(Vec<String>),
Exists {
entity: String,
criteria: Option<String>,
},
Referenced {
entity: String,
field: String,
},
Custom(Rc<dyn Fn(&Object, &dyn ObjectSpace) -> Result<(), String>>),
}Expand description
What a Rule asks for.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Required
The field has something in it.
Range
The field is within these limits.
Matches(String)
The field matches this regular expression.
Text
The field compares with this text.
Fields
§
comparison: TextComparisonHow.
Compare
The field compares with a value or another field.
Criteria(String)
The record meets this expression.
IsTrue
The field is true, as with an agreement.
Unique
No other record holds the same in the field.
UniqueTogether(Vec<String>)
No other record holds the same in all these fields together.
Exists
Some record of this entity meets this expression.
Fields
Referenced
Some record of this entity points to this one through this field.
Custom(Rc<dyn Fn(&Object, &dyn ObjectSpace) -> Result<(), String>>)
Anything else.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RuleKind
impl !Send for RuleKind
impl !Sync for RuleKind
impl !UnwindSafe for RuleKind
impl Freeze for RuleKind
impl Unpin for RuleKind
impl UnsafeUnpin for RuleKind
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