Enum dockerfile_parser::Instruction [−][src]
pub enum Instruction {
From(FromInstruction),
Arg(ArgInstruction),
Label(LabelInstruction),
Run(RunInstruction),
Entrypoint(EntrypointInstruction),
Cmd(CmdInstruction),
Copy(CopyInstruction),
Env(EnvInstruction),
Misc(MiscInstruction),
}
Expand description
A single Dockerfile instruction.
Individual instructions structures may be unpacked with pattern matching or
via the TryFrom
impls on each instruction type.
Example
use std::convert::TryInto;
use dockerfile_parser::*;
let dockerfile = Dockerfile::parse("FROM alpine:3.11").unwrap();
let from: &FromInstruction = dockerfile.instructions
.get(0).unwrap()
.try_into().unwrap();
assert_eq!(from.image_parsed.tag, Some("3.11".to_string()));
Variants
From(FromInstruction)
Tuple Fields
Arg(ArgInstruction)
Tuple Fields
Label(LabelInstruction)
Tuple Fields
Run(RunInstruction)
Tuple Fields
Entrypoint(EntrypointInstruction)
Tuple Fields
Cmd(CmdInstruction)
Tuple Fields
Copy(CopyInstruction)
Tuple Fields
Env(EnvInstruction)
Tuple Fields
Misc(MiscInstruction)
Tuple Fields
Implementations
Attempts to convert this instruction into a FromInstruction, returning None if impossible.
Attempts to convert this instruction into a FromInstruction, returning None if impossible.
Attempts to convert this instruction into an ArgInstruction, returning None if impossible.
Attempts to convert this instruction into an ArgInstruction, returning None if impossible.
Attempts to convert this instruction into a LabelInstruction, returning None if impossible.
Attempts to convert this instruction into a LabelInstruction, returning None if impossible.
Attempts to convert this instruction into a RunInstruction, returning None if impossible.
Attempts to convert this instruction into a RunInstruction, returning None if impossible.
Attempts to convert this instruction into an EntrypointInstruction, returning None if impossible.
Attempts to convert this instruction into an EntrypointInstruction, returning None if impossible.
Attempts to convert this instruction into a CmdInstruction, returning None if impossible.
Attempts to convert this instruction into a CmdInstruction, returning None if impossible.
Attempts to convert this instruction into a CopyInstruction, returning None if impossible.
Attempts to convert this instruction into a CopyInstruction, returning None if impossible.
Attempts to convert this instruction into an EnvInstruction, returning None if impossible.
Attempts to convert this instruction into an EnvInstruction, returning None if impossible.
Attempts to convert this instruction into a MiscInstruction, returning None if impossible.
Attempts to convert this instruction into a MiscInstruction, returning None if impossible.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations
Mutably borrows from an owned value. Read more