Skip to main content

Application

Struct Application 

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

One ordered multi-service application graph.

Implementations§

Source§

impl Application

Source

pub const fn new(name: Identifier) -> Self

Creates an empty application.

Source

pub const fn name(&self) -> &Identifier

Returns the application name.

Source

pub fn add_image_acquisition( &mut self, acquisition: Sourced<ImageAcquisition>, ) -> Result<(), ModelError>

Adds a uniquely named image-acquisition resource while preserving declaration order.

§Errors

Returns ModelError::DuplicateResource for a duplicate acquisition name.

Source

pub fn image_acquisitions(&self) -> &[Sourced<ImageAcquisition>]

Returns image-acquisition resources in declaration order.

Source

pub fn add_image_build( &mut self, build: Sourced<ImageBuild>, ) -> Result<(), ModelError>

Adds a uniquely named image-build resource while preserving declaration order.

§Errors

Returns ModelError::DuplicateResource for a duplicate build name.

Source

pub fn image_builds(&self) -> &[Sourced<ImageBuild>]

Returns image-build resources in declaration order.

Source

pub fn validate_image_artifact_references(&self) -> Result<(), ModelError>

Validates every typed image-artifact reference after the complete graph is assembled.

Unlike incremental insertion, this validation does not make a source document’s declaration order significant. Adapters that receive forward references should add their resources first and invoke this method before treating the application as convertible.

§Errors

Returns the matching unknown-reference error for a service or image-backed volume.

Source

pub fn validate_image_artifact_dependencies( &self, dependencies: &[Sourced<ArtifactDependency>], ) -> Result<(), ModelError>

Validates explicit format-neutral artifact edges for missing nodes and cycles.

The supplied edges must already be typed by a source adapter. In particular, BoxFerry does not parse native raw argument, mount, or unit-name text to infer dependencies. Duplicate edges are ignored deterministically, and input order does not affect validation.

§Errors

Returns a missing-reference error, ModelError::UnknownArtifactDependencyNode, or ModelError::ImageArtifactDependencyCycle.

Source

pub fn add_service( &mut self, service: Sourced<Service>, ) -> Result<(), ModelError>

Adds a uniquely named service while preserving declaration order.

§Errors

Returns ModelError::DuplicateResource for a duplicate service name, ModelError::UnknownImageAcquisitionReference, or ModelError::UnknownImageBuildReference for an unresolved artifact reference.

Source

pub fn services(&self) -> &[Sourced<Service>]

Returns services in declaration order.

Source

pub fn add_service_group( &mut self, group: Sourced<ServiceGroup>, ) -> Result<(), ModelError>

Adds a uniquely named structural service group.

Every referenced service must already exist in the application, and one service may belong to at most one group.

§Errors

Returns ModelError::DuplicateResource, ModelError::UnknownServiceGroupMember, or ModelError::ServiceInMultipleGroups when a relationship is ambiguous.

Source

pub fn service_groups(&self) -> &[Sourced<ServiceGroup>]

Returns structural service groups in source order.

Source

pub fn add_volume(&mut self, volume: Sourced<Volume>) -> Result<(), ModelError>

Adds a uniquely named volume while preserving declaration order.

§Errors

Returns ModelError::DuplicateResource for a duplicate volume name.

Source

pub fn volumes(&self) -> &[Sourced<Volume>]

Returns volumes in declaration order.

Source

pub fn add_network( &mut self, network: Sourced<Network>, ) -> Result<(), ModelError>

Adds a uniquely named network while preserving declaration order.

§Errors

Returns ModelError::DuplicateResource for a duplicate network name.

Source

pub fn networks(&self) -> &[Sourced<Network>]

Returns networks in declaration order.

Source

pub fn add_config(&mut self, config: Sourced<Config>) -> Result<(), ModelError>

Adds a uniquely named configuration while preserving declaration order.

§Errors

Returns ModelError::DuplicateResource for a duplicate configuration name.

Source

pub fn configs(&self) -> &[Sourced<Config>]

Returns configuration resources in declaration order.

Source

pub fn add_secret(&mut self, secret: Sourced<Secret>) -> Result<(), ModelError>

Adds a uniquely named secret while preserving declaration order.

§Errors

Returns ModelError::DuplicateResource for a duplicate secret name.

Source

pub fn secrets(&self) -> &[Sourced<Secret>]

Returns secret resources in declaration order.

Trait Implementations§

Source§

impl Clone for Application

Source§

fn clone(&self) -> Application

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 Application

Source§

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

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

impl Eq for Application

Source§

impl PartialEq for Application

Source§

fn eq(&self, other: &Application) -> 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 Application

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> 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.