pub struct DockerfileInstruction { /* private fields */ }Expand description
A single Dockerfile instruction line.
Implementations§
Source§impl DockerfileInstruction
impl DockerfileInstruction
Sourcepub fn new(
kind: DockerfileInstructionKind,
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn new( kind: DockerfileInstructionKind, arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates an instruction from a kind and argument text.
Sourcepub fn from(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn from( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a FROM instruction.
Sourcepub fn run(arguments: impl AsRef<str>) -> DockerfileInstruction
pub fn run(arguments: impl AsRef<str>) -> DockerfileInstruction
Creates a RUN instruction.
Sourcepub fn copy(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn copy( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a COPY instruction.
Sourcepub fn add(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn add( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates an ADD instruction.
Sourcepub fn cmd(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn cmd( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a CMD instruction.
Sourcepub fn entrypoint(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn entrypoint( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates an ENTRYPOINT instruction.
Sourcepub fn env(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn env( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates an ENV instruction.
Sourcepub fn arg(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn arg( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates an ARG instruction.
Sourcepub fn workdir(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn workdir( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a WORKDIR instruction.
Sourcepub fn expose(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn expose( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates an EXPOSE instruction.
Sourcepub fn label(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn label( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a LABEL instruction.
Sourcepub fn user(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn user( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a USER instruction.
Sourcepub fn volume(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn volume( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a VOLUME instruction.
Sourcepub fn healthcheck(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn healthcheck( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a HEALTHCHECK instruction.
Sourcepub fn stopsignal(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn stopsignal( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a STOPSIGNAL instruction.
Sourcepub fn shell(
arguments: impl AsRef<str>,
) -> Result<DockerfileInstruction, DockerfileInstructionError>
pub fn shell( arguments: impl AsRef<str>, ) -> Result<DockerfileInstruction, DockerfileInstructionError>
Creates a SHELL instruction.
Sourcepub const fn kind(&self) -> DockerfileInstructionKind
pub const fn kind(&self) -> DockerfileInstructionKind
Returns the instruction kind.
Trait Implementations§
Source§impl Clone for DockerfileInstruction
impl Clone for DockerfileInstruction
Source§fn clone(&self) -> DockerfileInstruction
fn clone(&self) -> DockerfileInstruction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DockerfileInstruction
impl Debug for DockerfileInstruction
Source§impl Display for DockerfileInstruction
impl Display for DockerfileInstruction
Source§impl FromStr for DockerfileInstruction
impl FromStr for DockerfileInstruction
Source§type Err = DockerfileInstructionError
type Err = DockerfileInstructionError
The associated error which can be returned from parsing.
Source§fn from_str(
value: &str,
) -> Result<DockerfileInstruction, <DockerfileInstruction as FromStr>::Err>
fn from_str( value: &str, ) -> Result<DockerfileInstruction, <DockerfileInstruction as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for DockerfileInstruction
impl Hash for DockerfileInstruction
Source§impl Ord for DockerfileInstruction
impl Ord for DockerfileInstruction
Source§fn cmp(&self, other: &DockerfileInstruction) -> Ordering
fn cmp(&self, other: &DockerfileInstruction) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DockerfileInstruction
impl PartialEq for DockerfileInstruction
Source§fn eq(&self, other: &DockerfileInstruction) -> bool
fn eq(&self, other: &DockerfileInstruction) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for DockerfileInstruction
impl PartialOrd for DockerfileInstruction
Source§impl TryFrom<&str> for DockerfileInstruction
impl TryFrom<&str> for DockerfileInstruction
Source§type Error = DockerfileInstructionError
type Error = DockerfileInstructionError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &str,
) -> Result<DockerfileInstruction, <DockerfileInstruction as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<DockerfileInstruction, <DockerfileInstruction as TryFrom<&str>>::Error>
Performs the conversion.
impl Eq for DockerfileInstruction
impl StructuralPartialEq for DockerfileInstruction
Auto Trait Implementations§
impl Freeze for DockerfileInstruction
impl RefUnwindSafe for DockerfileInstruction
impl Send for DockerfileInstruction
impl Sync for DockerfileInstruction
impl Unpin for DockerfileInstruction
impl UnsafeUnpin for DockerfileInstruction
impl UnwindSafe for DockerfileInstruction
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