Skip to main content

BuildDefinition

Struct BuildDefinition 

Source
pub struct BuildDefinition { /* private fields */ }
Expand description

A long-syntax build definition.

Implementations§

Source§

impl BuildDefinition

Source

pub const fn span(&self) -> SourceSpan

Returns the complete mapping span. Returns the complete update-config mapping span. Returns the complete update-config mapping span. Returns the complete update-config mapping span.

Source

pub const fn context(&self) -> Option<&Located<String>>

Returns the explicitly authored long-syntax build context when it is a string scalar.

Other build subfields remain source-addressable references and are not semantically interpreted by this model. Returns the raw update parallelism scalar.

Source

pub const fn additional_contexts(&self) -> Option<&BuildAdditionalContexts>

Returns authored additional build contexts without normalizing mapping and list syntax.

List entries remain raw ordered strings, including duplicates and NAME=VALUE spelling. Mapping entries retain scalar kinds and authored order. This model does not interpret names, paths, URLs, images, service schemes, or builder behavior. Returns the raw update delay string.

Source

pub fn entitlements(&self) -> Option<&[Located<String>]>

Returns authored build entitlements in order as opaque raw strings.

Explicit emptiness remains distinct from omission. This model retains duplicates and does not infer entitlement allowlists, privilege state, BuildKit or platform support, build execution, or runtime effect. Returns the raw update monitor string.

Source

pub const fn extra_hosts(&self) -> Option<&BuildExtraHosts>

Returns authored build-time host mappings without using service extra_hosts semantics.

List entries retain raw =/: spelling, IPv4/IPv6 brackets, host-gateway, and unknown values. Mapping values retain either a scalar string or ordered string list; no address normalization, validation, DNS lookup, host inspection, or build behavior is performed. Returns the raw update failure-action string.

Source

pub const fn args(&self) -> Option<&BuildArgs>

Returns explicitly authored build arguments without normalizing mapping and list syntax.

Mapping entries retain their string, number, boolean, or null scalar kinds. List entries remain raw ordered strings, including duplicates and bare argument names. Returns the raw update maximum-failure-ratio scalar.

Source

pub fn cache_from(&self) -> Option<&[Located<String>]>

Returns authored external build-cache sources in order.

An explicit empty sequence remains distinct from omission. Entries are raw string scalars; this model preserves duplicates and does not parse cache type, reference, source, path, image, credentials, or builder behavior. Returns the update order.

Source

pub fn cache_to(&self) -> Option<&[Located<String>]>

Returns authored external build-cache destinations in order.

An explicit empty sequence remains distinct from omission. Entries are raw string scalars; this model preserves duplicates and does not parse cache type, reference, destination, path, image, credentials, or builder behavior. Returns retained update-config extensions.

Source

pub const fn dockerfile(&self) -> Option<&Located<String>>

Returns the explicitly authored long-syntax Dockerfile when it is a non-empty scalar.

Other build subfields remain source-addressable references and are not semantically interpreted by this model. Returns retained update-config malformed or unknown fields.

Source

pub const fn dockerfile_inline(&self) -> Option<&Located<String>>

Returns the authored inline Dockerfile as an exact string scalar.

Empty and multiline content remains distinct from omission. ComposeLens does not parse Containerfile syntax, resolve paths or contexts, scan content for secrets, build images, or infer Docker, BuildKit, or runtime behavior.

Source

pub const fn target(&self) -> Option<&Located<String>>

Returns the explicitly authored long-syntax build target as an opaque scalar.

An empty scalar remains an authored target; this model does not infer stage-name grammar.

Source

pub fn network(&self) -> Option<&Located<String>>

Returns the explicitly authored long-syntax build network as an opaque scalar.

An empty scalar remains authored; this model does not infer network names, defaults, or runtime behavior.

Source

pub fn isolation(&self) -> Option<&Located<String>>

Returns the explicitly authored long-syntax build isolation as an opaque YAML string.

This model preserves only YAML string scalars and does not validate isolation modes, platforms, defaults, privileges, or BUILDAH_ISOLATION behavior. It is unrelated to the service-level isolation field.

Source

pub fn platforms(&self) -> Option<&[Located<String>]>

Returns explicitly authored build platforms in order.

An explicit empty sequence remains distinct from omission. Platforms are raw scalar values; this model does not parse OCI platform grammar or validate availability.

Source

pub fn no_cache(&self) -> Option<&Located<BuildNoCache>>

Returns the explicitly authored build cache-disable choice with YAML scalar type retained.

Omission does not imply a default. String values, including empty and interpolation-shaped strings, are not coerced or resolved as booleans; this model does not infer builder or cache behavior.

Source

pub const fn no_cache_filter(&self) -> Option<&BuildNoCacheFilter>

Returns raw no-cache filter scalar or list syntax.

Source

pub fn privileged(&self) -> Option<&Located<BooleanValue>>

Returns the explicit build privileged boolean or deferred expression.

Source

pub fn sbom(&self) -> Option<&Located<BuildSbom>>

Returns the explicitly authored build SBOM choice with YAML scalar type retained.

Omission does not imply a default. String values, including empty, generator-shaped, and interpolation-shaped strings, are not coerced or interpreted; this model does not generate an SBOM or infer builder behavior.

Source

pub fn provenance(&self) -> Option<&Located<BuildProvenance>>

Returns authored Build provenance as a boolean or opaque string scalar.

Source

pub fn pull(&self) -> Option<&Located<BooleanValue>>

Returns whether this build should pull referenced images before building.

A literal boolean and a deferred interpolation expression remain distinct. Omission is not treated as an implicit default, and this model does not resolve expressions or infer build execution behavior.

Source

pub fn shm_size(&self) -> Option<&ShmSize>

Returns the explicitly authored build-container shared-memory size.

This retains the same YAML number/string spelling, documented lowercase-unit classification, lexical-zero, deferred-expression, and provider-dependent states as service shm_size. Omission does not infer a builder default, allocation, host setting, or runtime behavior.

Source

pub fn tags(&self) -> Option<&[Located<String>]>

Returns explicitly authored additional build tags in order.

An explicit empty sequence remains distinct from omission. Tags are opaque scalar values; this model does not apply image-reference grammar or duplicate handling.

Source

pub fn labels(&self) -> Option<&Labels>

Returns explicitly authored build labels without normalizing mapping and list syntax.

List entries remain ordered raw strings, including duplicates and bare labels. Mapping entries retain their scalar kinds and authored order.

Source

pub fn secrets(&self) -> Option<&[SecretGrant]>

Returns explicitly authored build secret grants in order.

Short resource-name and long mapping syntax remain distinct. An explicit empty sequence, duplicate entries, raw scalar spellings, and unknown long-form fields are retained; this model neither resolves top-level secrets nor materializes secret contents.

Source

pub const fn ssh(&self) -> Option<&BuildSsh>

Returns authored BuildKit SSH grants without normalizing mapping and list syntax.

SSH identifiers, paths, agent sockets, and material are opaque sensitive data. This model neither parses them nor accesses the host, an agent, a socket, or a build runtime.

Source

pub fn ulimits(&self) -> Option<&Ulimits>

Returns explicitly authored build-container resource limits.

The same single and soft/hard range forms as service ulimits are retained. This model does not inject defaults, normalize unlimited values, validate host limits, or infer builder or runtime behavior.

Source

pub fn fields(&self) -> &[BuildField]

Returns recognized build fields in authored order.

Source

pub fn field(&self, kind: BuildFieldKind) -> Option<&BuildField>

Finds the first recognized field of the requested kind.

Source

pub fn extension_fields(&self) -> &[FieldReference]

Returns retained x- fields.

Source

pub fn unknown_fields(&self) -> &[FieldReference]

Returns fields not recognized by this release.

Trait Implementations§

Source§

impl Clone for BuildDefinition

Source§

fn clone(&self) -> BuildDefinition

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 BuildDefinition

Source§

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

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

impl Eq for BuildDefinition

Source§

impl PartialEq for BuildDefinition

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BuildDefinition

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
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.