pub struct Command { /* private fields */ }
Expand description
A Cloneable, Displayable clone of std::process::Command
Implementations
sourceimpl Command
impl Command
pub fn new(program: impl AsRef<OsStr>) -> Self
pub fn parse(command: impl AsRef<str>) -> Result<Self, String>
pub fn arg(&mut self, arg: impl AsRef<OsStr>) -> &mut Self
pub fn args<I: IntoIterator<Item = S>, S: AsRef<OsStr>>(
&mut self,
args: I
) -> &mut Self
pub fn env(
&mut self,
key: impl AsRef<OsStr>,
val: impl AsRef<OsStr>
) -> &mut Self
pub fn envs<I: IntoIterator<Item = (K, V)>, K: AsRef<OsStr>, V: AsRef<OsStr>>(
&mut self,
vars: I
) -> &mut Self
pub fn env_remove(&mut self, key: impl AsRef<OsStr>) -> &mut Self
pub fn env_clear(&mut self) -> &mut Self
pub fn current_dir(&mut self, dir: impl AsRef<Path>) -> &mut Self
pub fn stdin(&mut self, f: impl Fn() -> Stdio + 'static) -> &mut Self
pub fn stdout(&mut self, f: impl Fn() -> Stdio + 'static) -> &mut Self
pub fn stderr(&mut self, f: impl Fn() -> Stdio + 'static) -> &mut Self
pub fn to_command(&self) -> Command
pub fn spawn(&self) -> Result<Child>
pub fn output(&self) -> Result<Output>
pub fn status(&self) -> Result<ExitStatus>
Trait Implementations
sourceimpl CommandExt for Command
impl CommandExt for Command
sourcefn status0(&mut self) -> Result<()>
fn status0(&mut self) -> Result<()>
Command::status, but returns an error if the process didn’t have a zero exit code
sourcefn output0(&mut self) -> Result<Output>
fn output0(&mut self) -> Result<Output>
Command::output, but returns an error if the process didn’t have a zero exit code
sourcefn stdout0_no_stderr(&mut self) -> Result<String>
fn stdout0_no_stderr(&mut self) -> Result<String>
Command::output, but: Read more
Auto Trait Implementations
impl !RefUnwindSafe for Command
impl !Send for Command
impl !Sync for Command
impl Unpin for Command
impl !UnwindSafe for Command
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more