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: Span
§expr: ShellOrExecExpr
Implementations§
Source§impl 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§
Source§impl Clone for CmdInstruction
impl Clone for CmdInstruction
Source§fn clone(&self) -> CmdInstruction
fn clone(&self) -> CmdInstruction
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CmdInstruction
impl Debug for CmdInstruction
Source§impl From<CmdInstruction> for Instruction
impl From<CmdInstruction> for Instruction
Source§fn from(ins: CmdInstruction) -> Self
fn from(ins: CmdInstruction) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CmdInstruction
impl PartialEq for CmdInstruction
Source§impl<'a> TryFrom<&'a Instruction> for &'a CmdInstruction
impl<'a> TryFrom<&'a Instruction> for &'a CmdInstruction
impl Eq for CmdInstruction
impl StructuralPartialEq for CmdInstruction
Auto Trait Implementations§
impl Freeze for CmdInstruction
impl RefUnwindSafe for CmdInstruction
impl Send for CmdInstruction
impl Sync for CmdInstruction
impl Unpin for CmdInstruction
impl UnwindSafe for CmdInstruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more