pub struct ContractUse {Show 15 fields
pub source_expr: String,
pub path: YamlPath,
pub kind: ValueKind,
pub condition: GuardDnf,
pub resource: Option<ResourceRef>,
pub provenance: Vec<ContractProvenance>,
pub has_string_contract: bool,
pub template_supplied_member_keys: BTreeSet<String>,
pub split_segment: Option<SplitSegmentUse>,
pub merge_layers: Option<MergeLayersUse>,
pub range_key: bool,
pub nil_omitting: bool,
pub omitted_members: BTreeMap<String, Vec<Guard>>,
pub digest: bool,
pub merge_operand: bool,
}Expand description
A contract claim for one observed values path.
Fields§
§source_expr: StringCanonical values path or expression that supplied the rendered value.
path: YamlPathStructural path of the value in the rendered YAML document.
kind: ValueKindHow the value contributes to the rendered YAML node.
condition: GuardDnfNormalized condition under which the use renders.
resource: Option<ResourceRef>Kubernetes resource owning the rendered path, when known.
provenance: Vec<ContractProvenance>Template locations and helper chains that produced the use.
has_string_contract: boolA string-consuming transform (trunc, b64enc, a dynamic printf
format) produced this rendered text: rendering fails for non-string
values, but only where THIS row’s condition holds.
template_supplied_member_keys: BTreeSet<String>Literal member keys the TEMPLATE writes beside this fragment splice
in the same mapping (- name: tmp next to toYaml .Values.tmpVolume):
the rendered object already has them, so a provider slot’s object
requiredness must not re-demand them from the user value.
split_segment: Option<SplitSegmentUse>Set when the rendered text is one separator-delimited segment of the source string rather than the raw value.
merge_layers: Option<MergeLayersUse>Set when the value renders as one layer of an ordered merge.
range_key: boolSet when the rendered text is the collection’s RANGE KEY rather than its value: the sink constrains the key domain only.
nil_omitting: boolThe rendered text is a Sprig quote/squote of the value, which
skips nil operands: a missing or null source renders an explicit
YAML null into the sink (see
ProviderSchemaUse::nil_omitting).
omitted_members: BTreeMap<String, Vec<Guard>>Literal member keys a guard-scoped omit may remove from the
rendered map before the sink reads it. Each key maps to the sound
RETAIN guards under which the key certainly survives (the omitting
arm certainly did not run); an empty guard list means the key’s
survival is undecidable and its sink typing must abstain entirely.
digest: boolSet when the slot renders fresh text DERIVED from the value
(include … | sha256sum checksum annotations): the sink observes
neither the value nor its serialization, so the row grants its
branch serialized tolerance without claiming a path-wide
serialization use.
merge_operand: boolSet when the value flowed through a Sprig merge call as a DIRECT
operand: the operand’s strict map contract rides its own fail
implication (keyed on the call’s live gate), so this row never
rejects a Helm-falsy input at the base.
Implementations§
Source§impl ContractUse
impl ContractUse
Sourcepub fn new(
source_expr: String,
path: YamlPath,
kind: ValueKind,
guards: Vec<Guard>,
resource: Option<ResourceRef>,
) -> Self
pub fn new( source_expr: String, path: YamlPath, kind: ValueKind, guards: Vec<Guard>, resource: Option<ResourceRef>, ) -> Self
Creates a contract use from one conjunction of guards.
Sourcepub fn with_provenances(
source_expr: String,
path: YamlPath,
kind: ValueKind,
guards: Vec<Guard>,
resource: Option<ResourceRef>,
provenance: impl IntoIterator<Item = ContractProvenance>,
) -> Self
pub fn with_provenances( source_expr: String, path: YamlPath, kind: ValueKind, guards: Vec<Guard>, resource: Option<ResourceRef>, provenance: impl IntoIterator<Item = ContractProvenance>, ) -> Self
Creates a guarded contract use with explicit source provenance.
Sourcepub fn with_condition_and_provenances(
source_expr: String,
path: YamlPath,
kind: ValueKind,
condition: GuardDnf,
resource: Option<ResourceRef>,
provenance: impl IntoIterator<Item = ContractProvenance>,
) -> Self
pub fn with_condition_and_provenances( source_expr: String, path: YamlPath, kind: ValueKind, condition: GuardDnf, resource: Option<ResourceRef>, provenance: impl IntoIterator<Item = ContractProvenance>, ) -> Self
Creates a contract use from an already-normalized condition.
Sourcepub fn canonicalize(&mut self)
pub fn canonicalize(&mut self)
Sorts and deduplicates provenance without changing semantic evidence.
Sourcepub fn single_guard_conjunction(&self) -> Vec<Guard>
pub fn single_guard_conjunction(&self) -> Vec<Guard>
Returns the sole guard conjunction, or an empty conjunction when not singular.
Trait Implementations§
Source§impl Clone for ContractUse
impl Clone for ContractUse
Source§fn clone(&self) -> ContractUse
fn clone(&self) -> ContractUse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more