[−][src]Enum dockerfile_parser::Instruction
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)
Arg(ArgInstruction)
Label(LabelInstruction)
Run(RunInstruction)
Entrypoint(EntrypointInstruction)
Cmd(CmdInstruction)
Copy(CopyInstruction)
Env(EnvInstruction)
Misc(MiscInstruction)
Implementations
impl Instruction
[src]
pub fn into_from(self) -> Option<FromInstruction>
[src]
Attempts to convert this instruction into a FromInstruction, returning None if impossible.
pub fn as_from(&self) -> Option<&FromInstruction>
[src]
Attempts to convert this instruction into a FromInstruction, returning None if impossible.
pub fn into_arg(self) -> Option<ArgInstruction>
[src]
Attempts to convert this instruction into an ArgInstruction, returning None if impossible.
pub fn as_arg(&self) -> Option<&ArgInstruction>
[src]
Attempts to convert this instruction into an ArgInstruction, returning None if impossible.
pub fn into_label(self) -> Option<LabelInstruction>
[src]
Attempts to convert this instruction into a LabelInstruction, returning None if impossible.
pub fn as_label(&self) -> Option<&LabelInstruction>
[src]
Attempts to convert this instruction into a LabelInstruction, returning None if impossible.
pub fn into_run(self) -> Option<RunInstruction>
[src]
Attempts to convert this instruction into a RunInstruction, returning None if impossible.
pub fn as_run(&self) -> Option<&RunInstruction>
[src]
Attempts to convert this instruction into a RunInstruction, returning None if impossible.
pub fn into_entrypoint(self) -> Option<EntrypointInstruction>
[src]
Attempts to convert this instruction into an EntrypointInstruction, returning None if impossible.
pub fn as_entrypoint(&self) -> Option<&EntrypointInstruction>
[src]
Attempts to convert this instruction into an EntrypointInstruction, returning None if impossible.
pub fn into_cmd(self) -> Option<CmdInstruction>
[src]
Attempts to convert this instruction into a CmdInstruction, returning None if impossible.
pub fn as_cmd(&self) -> Option<&CmdInstruction>
[src]
Attempts to convert this instruction into a CmdInstruction, returning None if impossible.
pub fn into_copy(self) -> Option<CopyInstruction>
[src]
Attempts to convert this instruction into a CopyInstruction, returning None if impossible.
pub fn as_copy(&self) -> Option<&CopyInstruction>
[src]
Attempts to convert this instruction into a CopyInstruction, returning None if impossible.
pub fn into_env(self) -> Option<EnvInstruction>
[src]
Attempts to convert this instruction into an EnvInstruction, returning None if impossible.
pub fn as_env(&self) -> Option<&EnvInstruction>
[src]
Attempts to convert this instruction into an EnvInstruction, returning None if impossible.
pub fn into_misc(self) -> Option<MiscInstruction>
[src]
Attempts to convert this instruction into a MiscInstruction, returning None if impossible.
pub fn as_misc(&self) -> Option<&MiscInstruction>
[src]
Attempts to convert this instruction into a MiscInstruction, returning None if impossible.
Trait Implementations
impl Clone for Instruction
[src]
fn clone(&self) -> Instruction
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Instruction
[src]
impl Eq for Instruction
[src]
impl From<ArgInstruction> for Instruction
[src]
fn from(ins: ArgInstruction) -> Self
[src]
impl From<CmdInstruction> for Instruction
[src]
fn from(ins: CmdInstruction) -> Self
[src]
impl From<CopyInstruction> for Instruction
[src]
fn from(ins: CopyInstruction) -> Self
[src]
impl From<EntrypointInstruction> for Instruction
[src]
fn from(ins: EntrypointInstruction) -> Self
[src]
impl From<EnvInstruction> for Instruction
[src]
fn from(ins: EnvInstruction) -> Self
[src]
impl From<FromInstruction> for Instruction
[src]
fn from(ins: FromInstruction) -> Self
[src]
impl From<LabelInstruction> for Instruction
[src]
fn from(ins: LabelInstruction) -> Self
[src]
impl From<MiscInstruction> for Instruction
[src]
fn from(ins: MiscInstruction) -> Self
[src]
impl From<RunInstruction> for Instruction
[src]
fn from(ins: RunInstruction) -> Self
[src]
impl PartialEq<Instruction> for Instruction
[src]
fn eq(&self, other: &Instruction) -> bool
[src]
fn ne(&self, other: &Instruction) -> bool
[src]
impl StructuralEq for Instruction
[src]
impl StructuralPartialEq for Instruction
[src]
impl<'a> TryFrom<&'a Instruction> for &'a FromInstruction
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(instruction: &'a Instruction) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a Instruction> for &'a CopyInstruction
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(instruction: &'a Instruction) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a Instruction> for &'a ArgInstruction
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(instruction: &'a Instruction) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a Instruction> for &'a LabelInstruction
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(instruction: &'a Instruction) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a Instruction> for &'a EnvInstruction
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(instruction: &'a Instruction) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a Instruction> for &'a RunInstruction
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(instruction: &'a Instruction) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a Instruction> for &'a CmdInstruction
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(instruction: &'a Instruction) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a Instruction> for &'a MiscInstruction
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(instruction: &'a Instruction) -> Result<Self, Self::Error>
[src]
impl TryFrom<Instruction> for EntrypointInstruction
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(instruction: Instruction) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<Pair<'_, Rule>> for Instruction
[src]
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
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,
pub 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<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[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.
pub 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>,