pub struct Command { /* private fields */ }
Expand description
A command wrapper that simplifies interaction with external commands.
Implementations§
Source§impl Command
impl Command
Sourcepub fn working_directory(&mut self, path: impl AsRef<Path>)
pub fn working_directory(&mut self, path: impl AsRef<Path>)
Configure the working directory of this command.
Sourcepub fn run_lines(self) -> Result<Vec<String>, Error>
pub fn run_lines(self) -> Result<Vec<String>, Error>
Run the given command, return all lines printed to stdout on success.
Sourcepub fn run_stdout(self) -> Result<String, Error>
pub fn run_stdout(self) -> Result<String, Error>
Run the given command, return a string of all output.
Sourcepub fn run_checked(self) -> Result<(), Error>
pub fn run_checked(self) -> Result<(), Error>
Run the given command, only checking for status code and providing diagnostics.
Sourcepub fn run_inherited(&self) -> Result<(), Error>
pub fn run_inherited(&self) -> Result<(), Error>
Run the given command, inheriting stdout, stderr from the current process.
This is discouraged, since it basically requires the command to be running on the main thread.
Sourcepub fn status(self) -> Result<ExitStatus>
pub fn status(self) -> Result<ExitStatus>
Run the command and wait for exit status.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Command
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