#[non_exhaustive]pub enum Condition {
Equal {
key: String,
value: Value,
},
NotEqual {
key: String,
value: Value,
},
Less {
key: String,
value: Value,
},
LessEqual {
key: String,
value: Value,
},
Greater {
key: String,
value: Value,
},
GreaterEqual {
key: String,
value: Value,
},
In {
key: String,
values: Vec<Value>,
},
NotIn {
key: String,
values: Vec<Value>,
},
Exists {
key: String,
},
NotExists {
key: String,
},
}Expand description
A single comparison operator applied to one metadata key.
Equality, range, and membership conditions require a concrete stored value.
An absent key or Value::Unset produces an unknown outcome. Comparisons
of concrete values can also be unknown when their types or operations are
incompatible or a numeric comparison fails; compatible numeric types follow
the configured NumericComparisonPolicy, and values are not implicitly
converted. Unknown remains unknown under logical negation, so ne, negated
comparisons, and not_in_set cannot bypass an incomparable type.
Existence conditions define presence in terms of a concrete value and return
definite Boolean outcomes. Membership conditions compare candidates
individually and prefer a definite result over an unknown candidate.
§Examples
use qubit_metadata::Condition;
let condition = Condition::Equal {
key: "tenant".to_owned(),
value: "acme".into(),
};
assert!(matches!(condition, Condition::Equal { .. }));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Equal
Key equals value.
NotEqual
Key does not equal value.
Less
Key is less than value.
LessEqual
Key is less than or equal to value.
Greater
Key is greater than value.
GreaterEqual
Key is greater than or equal to value.
In
The stored value is one of the listed candidates.
NotIn
The stored value is not any of the listed candidates.
Exists
The key stores a concrete value.
An absent key or a key storing Value::Unset does not exist for
filter matching.
NotExists
The key does not store a concrete value.
An absent key or a key storing Value::Unset satisfies this
condition.
Trait Implementations§
Source§impl Redact for Condition
impl Redact for Condition
Source§fn write_redacted(&self, writer: &mut RedactionWriter<'_>)
fn write_redacted(&self, writer: &mut RedactionWriter<'_>)
Writes a diagnostic condition representation under the active policy.
The discriminant is inspected and an optional operand is borrowed before the record node is entered. The record and synthetic operator field consume node budget, as do admitted key and operand fields. Field formatting is deferred until admission; opaque masking skips operand formatting. A node-budget rejection adds a structural truncation field and stops the branch before formatting that field.
§Parameters
writer- Structured destination carrying the active policy and cumulative domain budgets.