[−][src]Struct dockerfile_parser::Stages
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
impl<'a> Stages<'a>
[src]
pub fn new(dockerfile: &'a Dockerfile) -> Stages<'a>
[src]
pub fn get_by_name(&'a self, name: &str) -> Option<&'a Stage<'a>>
[src]
Attempts to fetch a stage by its name (FROM
alias).
pub fn get(&'a self, s: &str) -> Option<&'a Stage<'a>>
[src]
Attempts to fetch a stage by its string representation.
Stages with a valid integer value are retrieved by index, otherwise by name.
pub fn iter(&self) -> Iter<Stage<'a>>
[src]
Returns an iterator over stages
, wrapping the underlying Vec::iter()
.
Trait Implementations
impl<'a> Debug for Stages<'a>
[src]
impl<'a> Index<usize> for Stages<'a>
[src]
type Output = Stage<'a>
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
impl<'a> IntoIterator for Stages<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Stages<'a>
impl<'a> Send for Stages<'a>
impl<'a> Sync for Stages<'a>
impl<'a> Unpin for Stages<'a>
impl<'a> UnwindSafe for Stages<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,