Struct dockerfile_parser::CmdInstruction
source · [−]pub struct CmdInstruction {
pub span: Span,
pub expr: ShellOrExecExpr,
}Expand description
A Dockerfile CMD instruction.
An command may be defined as either a single string (to be run in the default shell), or a list of strings (to be run directly).
Fields
span: Spanexpr: ShellOrExecExprImplementations
sourceimpl CmdInstruction
impl CmdInstruction
sourcepub fn into_shell(self) -> Option<BreakableString>
pub fn into_shell(self) -> Option<BreakableString>
Unpacks this instruction into its inner value if it is a Shell-form instruction, otherwise returns None.
sourcepub fn as_shell(&self) -> Option<&BreakableString>
pub fn as_shell(&self) -> Option<&BreakableString>
Unpacks this instruction into its inner value if it is a Shell-form instruction, otherwise returns None.
sourcepub fn into_exec(self) -> Option<StringArray>
pub fn into_exec(self) -> Option<StringArray>
Unpacks this instruction into its inner value if it is an Exec-form instruction, otherwise returns None.
sourcepub fn as_exec(&self) -> Option<&StringArray>
pub fn as_exec(&self) -> Option<&StringArray>
Unpacks this instruction into its inner value if it is an Exec-form instruction, otherwise returns None.
Trait Implementations
sourceimpl Clone for CmdInstruction
impl Clone for CmdInstruction
sourcefn clone(&self) -> CmdInstruction
fn clone(&self) -> CmdInstruction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for CmdInstruction
impl Debug for CmdInstruction
sourceimpl From<CmdInstruction> for Instruction
impl From<CmdInstruction> for Instruction
sourcefn from(ins: CmdInstruction) -> Self
fn from(ins: CmdInstruction) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<CmdInstruction> for CmdInstruction
impl PartialEq<CmdInstruction> for CmdInstruction
sourcefn eq(&self, other: &CmdInstruction) -> bool
fn eq(&self, other: &CmdInstruction) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &CmdInstruction) -> bool
fn ne(&self, other: &CmdInstruction) -> bool
This method tests for !=.
sourceimpl<'a> TryFrom<&'a Instruction> for &'a CmdInstruction
impl<'a> TryFrom<&'a Instruction> for &'a CmdInstruction
impl Eq for CmdInstruction
impl StructuralEq for CmdInstruction
impl StructuralPartialEq for CmdInstruction
Auto Trait Implementations
impl RefUnwindSafe for CmdInstruction
impl Send for CmdInstruction
impl Sync for CmdInstruction
impl Unpin for CmdInstruction
impl UnwindSafe for CmdInstruction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more