Struct dockerfile_parser::Stages[][src]

pub struct Stages<'a> {
    pub stages: Vec<Stage<'a>>,
}
Expand description

A collection of stages in a [multi-stage build].

Example

use dockerfile_parser::Dockerfile;

let dockerfile = Dockerfile::parse(r#"
  FROM alpine:3.12 as build
  RUN echo "hello world" > /foo

  FROM ubuntu:18.04
  COPY --from=0 /foo /foo
"#).unwrap();

for stage in dockerfile.stages() {
  println!("stage #{}, name: {:?}", stage.index, stage.name)
}

Fields

stages: Vec<Stage<'a>>

Implementations

Attempts to fetch a stage by its name (FROM alias).

Attempts to fetch a stage by its string representation.

Stages with a valid integer value are retrieved by index, otherwise by name.

Returns an iterator over stages, wrapping the underlying Vec::iter().

Trait Implementations

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.