pub enum Predicate {
Always,
Compare {
attr: String,
op: Comparison,
value: Value,
},
AllOf {
matchers: Vec<Predicate>,
},
AnyOf {
matchers: Vec<Predicate>,
},
Not {
matcher: Box<Predicate>,
},
}Expand description
One node of the predicate tree. Tagged via kind for serde so the JSON
stays readable.
Variants§
Always
Always true. Useful as a default-match.
Compare
Look at subject.attrs[attr] and compare it to value with op.
Fields
§
op: ComparisonComparison operator.
AllOf
All children must match.
AnyOf
At least one child must match.
Not
Inverts the child.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Predicate
impl<'de> Deserialize<'de> for Predicate
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 Predicate
impl RefUnwindSafe for Predicate
impl Send for Predicate
impl Sync for Predicate
impl Unpin for Predicate
impl UnsafeUnpin for Predicate
impl UnwindSafe for Predicate
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