pub enum ConditionalGuard {
Show 17 variants
Truthy {
path: String,
},
With {
path: String,
},
Eq {
path: String,
value: GuardValue,
},
NotEq {
path: String,
value: GuardValue,
},
Absent {
path: String,
},
TypeIs {
path: String,
schema_type: String,
},
MatchesPattern {
path: String,
pattern: String,
},
IntGt {
path: String,
bound: i64,
},
IntLt {
path: String,
bound: i64,
},
HasKey {
path: String,
key: String,
},
ContainsMemberEquals {
path: String,
member: String,
value: GuardValue,
},
ContainsEquals {
path: String,
value: GuardValue,
},
AtMostOneMember {
path: String,
},
MinMembers {
path: String,
bound: i64,
},
Not(Box<ConditionalGuard>),
AllOf(Vec<ConditionalGuard>),
AnyOf(Vec<ConditionalGuard>),
}Expand description
Values-decidable guard expression that can be lowered into JSON Schema conditionals.
Variants§
Truthy
The value at path is Helm-truthy.
With
A with action selected the non-empty value at path.
Eq
The value at path equals a literal.
Fields
value: GuardValueLiteral required at the path.
NotEq
The value at path differs from a literal.
Fields
value: GuardValueLiteral excluded at the path.
Absent
The value at path is absent.
TypeIs
The value at path has a specific JSON Schema type.
Fields
MatchesPattern
The string at path matches a regular expression.
Fields
IntGt
The path’s RAW value is a JSON integer strictly greater than bound
— a sound SUBSET of the Sprig coercion (gt (int64 x) bound) it
stands in for, valid only where firing less often is safe.
Fields
IntLt
The mirror of ConditionalGuard::IntGt: the path’s RAW value is a
JSON integer strictly less than bound, under the same sound-subset
contract.
Fields
HasKey
The mapping at path contains the literal member key. The key is
an OPAQUE property name (it may contain dots), so it rides beside
the segmented path instead of being appended to it.
Fields
ContainsMemberEquals
SOME iterated item of the collection at path has member equal to
value — the document-level meaning of a range-sentinel flag
(Range(path) ∧ Eq(path.*.member, value)). Lowers to contains
over the array lane and the double-negated member quantifier over
the object lane.
Fields
value: GuardValueLiteral that at least one member must equal.
ContainsEquals
SOME item of the list at path deep-equals the scalar literal —
Sprig has LITERAL .Values.list. has returns false on a nil
haystack and aborts on non-lists, so the guard holds exactly for
arrays carrying the literal; lowers to contains with a const
item.
Fields
value: GuardValueLiteral that at least one list item must equal.
AtMostOneMember
The collection at path has at most one entry — the document-level
form of “every iteration of this range is the first” (an
empty-initialized dedup accumulator cannot have shadowed anything).
A sound subset: it may only scope positive-polarity evidence.
MinMembers
The value at path is a mapping with at least bound members
(gt (keys X | len) N). Exact: both polarities encode.
Fields
Not(Box<ConditionalGuard>)
Logical negation of a guard.
AllOf(Vec<ConditionalGuard>)
Conjunction of every enclosed guard.
AnyOf(Vec<ConditionalGuard>)
Disjunction of the enclosed guards.
Implementations§
Source§impl ConditionalGuard
impl ConditionalGuard
Sourcepub fn value_paths(&self) -> BTreeSet<String>
pub fn value_paths(&self) -> BTreeSet<String>
Returns every values path referenced by this guard tree.
Trait Implementations§
Source§impl Clone for ConditionalGuard
impl Clone for ConditionalGuard
Source§fn clone(&self) -> ConditionalGuard
fn clone(&self) -> ConditionalGuard
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more