pub struct ComposeDocument { /* private fields */ }Expand description
A source-aware native Compose document.
Implementations§
Source§impl ComposeDocument
impl ComposeDocument
Sourcepub fn parse(syntax: &SyntaxDocument) -> ModelParse
pub fn parse(syntax: &SyntaxDocument) -> ModelParse
Extracts the initial typed Compose subset from a loss-aware syntax document.
Parsing does not interpolate values, apply defaults, normalize short and long forms, or access the environment. Structural problems produce diagnostics and as much typed data as can be recovered.
Sourcepub const fn span(&self) -> SourceSpan
pub const fn span(&self) -> SourceSpan
Returns the typed root mapping span.
Sourcepub const fn name(&self) -> Option<&Located<String>>
pub const fn name(&self) -> Option<&Located<String>>
Returns the explicitly authored project name.
Sourcepub fn service(&self, name: &str) -> Option<&Service>
pub fn service(&self, name: &str) -> Option<&Service>
Finds the first service with the requested name.
Sourcepub fn validate_dependencies(&self) -> Vec<Diagnostic>
pub fn validate_dependencies(&self) -> Vec<Diagnostic>
Validates dependency targets and service_healthy health-check requirements in this document.
Multi-file callers should validate the merged project view through
crate::resolution::validate_references instead.
Sourcepub fn networks(&self) -> &[NetworkDefinition]
pub fn networks(&self) -> &[NetworkDefinition]
Returns top-level network definitions in authored order.
Sourcepub fn volumes(&self) -> &[VolumeDefinition]
pub fn volumes(&self) -> &[VolumeDefinition]
Returns top-level volume definitions in authored order.
Sourcepub fn configs(&self) -> &[ConfigDefinition]
pub fn configs(&self) -> &[ConfigDefinition]
Returns top-level config definitions in authored order.
Sourcepub fn secrets(&self) -> &[SecretDefinition]
pub fn secrets(&self) -> &[SecretDefinition]
Returns top-level secret definitions in authored order.
Sourcepub fn extension_fields(&self) -> &[FieldReference]
pub fn extension_fields(&self) -> &[FieldReference]
Returns retained top-level x- extension fields.
Sourcepub fn unknown_fields(&self) -> &[FieldReference]
pub fn unknown_fields(&self) -> &[FieldReference]
Returns top-level fields not yet represented by the typed subset.
Trait Implementations§
Source§impl Clone for ComposeDocument
impl Clone for ComposeDocument
Source§fn clone(&self) -> ComposeDocument
fn clone(&self) -> ComposeDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more