pub struct Condition {
pub field: String,
pub operator: Operator,
pub value: Value,
}Expand description
A query condition for filtering
Fields§
§field: String§operator: Operator§value: ValueImplementations§
Source§impl Condition
impl Condition
pub fn new(field: impl Into<String>, operator: Operator, value: Value) -> Self
Sourcepub fn evaluate(&self, properties: &HashMap<String, PropValue>) -> bool
pub fn evaluate(&self, properties: &HashMap<String, PropValue>) -> bool
Evaluate condition against properties.
Properties carry real types now, so a numeric comparison against an int or float is exact rather than a parse of its rendering. A string that happens to hold a number still compares numerically, so queries written against the old string-only storage keep working.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Condition
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnsafeUnpin for Condition
impl UnwindSafe for Condition
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