[−][src]Struct devbox_build::Cmd
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]
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
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
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]
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,