pub struct LoadedProject { /* private fields */ }Expand description
An ordered set of parsed Compose documents and their path origins.
File order is semantically significant. The first document supplies the project directory used
by Compose’s multi-file relative-path rules, while every document retains its own origin for
provenance and future include support.
Implementations§
Source§impl LoadedProject
impl LoadedProject
Sourcepub fn load(
inputs: impl IntoIterator<Item = DocumentInput>,
) -> Result<Self, ProjectLoadError>
pub fn load( inputs: impl IntoIterator<Item = DocumentInput>, ) -> Result<Self, ProjectLoadError>
Parses ordered, caller-supplied documents into a loaded project.
Recoverable YAML and typed-model problems remain available in Self::diagnostics. No
interpolation or merge is performed by this operation.
§Errors
Returns ProjectLoadError when no document is supplied, a source identifier is reused, or
one source exceeds the syntax tree’s byte-offset capacity.
Sourcepub fn documents(&self) -> &[LoadedDocument]
pub fn documents(&self) -> &[LoadedDocument]
Returns documents in caller-supplied merge order.
Sourcepub fn document(&self, source_id: SourceId) -> Option<&LoadedDocument>
pub fn document(&self, source_id: SourceId) -> Option<&LoadedDocument>
Finds a document by its unique source identifier.
Sourcepub fn base_directory(&self) -> &Path
pub fn base_directory(&self) -> &Path
Returns the project directory inherited from the first document.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Returns aggregated syntax and typed-model diagnostics in document order.
Sourcepub fn interpolate(
&self,
environment: &dyn EnvironmentProvider,
) -> ProjectInterpolation
pub fn interpolate( &self, environment: &dyn EnvironmentProvider, ) -> ProjectInterpolation
Interpolates each document independently, in file order, without modifying the project.
Sourcepub fn interpolate_with_options(
&self,
environment: &dyn EnvironmentProvider,
options: InterpolationOptions,
) -> ProjectInterpolation
pub fn interpolate_with_options( &self, environment: &dyn EnvironmentProvider, options: InterpolationOptions, ) -> ProjectInterpolation
Interpolates each document independently with explicit options.
Trait Implementations§
Source§impl Clone for LoadedProject
impl Clone for LoadedProject
Source§fn clone(&self) -> LoadedProject
fn clone(&self) -> LoadedProject
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more