pub struct Command { /* private fields */ }
Expand description
A Cloneable, Displayable clone of std::process::Command
Implementations§
source§impl 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§
source§impl CommandExt for Command
impl CommandExt for Command
source§fn 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
source§fn 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
source§fn 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§
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