Skip to main content

ContractUse

Struct ContractUse 

Source
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: String

Canonical values path or expression that supplied the rendered value.

§path: YamlPath

Structural path of the value in the rendered YAML document.

§kind: ValueKind

How the value contributes to the rendered YAML node.

§condition: GuardDnf

Normalized 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: bool

A 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: bool

Set when the rendered text is the collection’s RANGE KEY rather than its value: the sink constrains the key domain only.

§nil_omitting: bool

The 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: bool

Set 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: bool

Set 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

Source

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.

Source

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.

Source

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.

Source

pub fn canonicalize(&mut self)

Sorts and deduplicates provenance without changing semantic evidence.

Source

pub fn single_guard_conjunction(&self) -> Vec<Guard>

Returns the sole guard conjunction, or an empty conjunction when not singular.

Source

pub fn map_value_paths<F>(&mut self, map: &mut F)
where F: FnMut(&str) -> String,

Rewrites the source expression and every values path in the condition.

Trait Implementations§

Source§

impl Clone for ContractUse

Source§

fn clone(&self) -> ContractUse

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ContractUse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ContractUse

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ContractUse

Source§

impl Hash for ContractUse

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ContractUse

Source§

fn cmp(&self, other: &ContractUse) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ContractUse

Source§

fn eq(&self, other: &ContractUse) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for ContractUse

Source§

fn partial_cmp(&self, other: &ContractUse) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for ContractUse

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ContractUse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.