#[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 that remains
unknown under logical negation and therefore fails closed when matching.
Existence conditions define presence in terms of a concrete value.
§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 condition node is entered before its discriminant is inspected. The synthetic operator label is derived from that discriminant and does not consume a field node. The source key and optional operand fields are admitted in source order. Accessors are invoked only after admission; operand access is skipped for opaque masking but remains available to a disabled policy that intentionally restores source values. A node-budget rejection adds one structural truncation field and terminates the branch without touching the rejected field.
§Parameters
writer- Structured destination carrying the active policy and cumulative domain budgets.