[][src]Struct devbox_build::Cmd

pub struct Cmd { /* fields omitted */ }

Clone-able variant of std::process::Command with some build specific helper methods

Cloning allows configuring commands with some common arguments and then invoking it with additional arguments/env vars at different places inside the script.

Method of this type are mirroring those of std::process::Command with addition of run and run_result commands for easier use inside of build sript.

Implementations

impl Cmd[src]

pub fn new<S: AsRef<OsStr>>(program: S) -> Self[src]

Constructs a new Cmd for launching the executable at path program

pub fn arg<S: AsRef<OsStr>>(self, arg: S) -> Self[src]

Adds an argument to the list of execution arguments

pub fn args<I, S>(self, args: I) -> Self where
    I: IntoIterator<Item = S>,
    S: AsRef<OsStr>, 
[src]

Adds multiple arguments to the list of execution arguments

pub fn env<K: AsRef<OsStr>, V: AsRef<OsStr>>(self, env: K, val: V) -> Self[src]

Sets an environment variable

pub fn run(&self)[src]

Run the command and exit the build with informative panic message.

This is convienece method for calling std::process::Command::status() method on command instance retrieved by command method

pub fn run_result(&self) -> Result<ExitStatus>[src]

Run the command and return it's status.

This is convienece method for calling std::process::Command::status() method on command instance retrieved by command method

pub fn command(&self) -> Command[src]

Build the std::process::Command with args and environment variables set up by methods on this Cmd instance.

Trait Implementations

impl Clone for Cmd[src]

impl Debug for Cmd[src]

Auto Trait Implementations

impl RefUnwindSafe for Cmd

impl Send for Cmd

impl Sync for Cmd

impl Unpin for Cmd

impl UnwindSafe for Cmd

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.