pub struct Command<'a> { /* private fields */ }
Expand description
A builder for launching a command inside the guest.
This has a similar API to std::process::Command
.
Implementations§
Source§impl<'a> Command<'a>
impl<'a> Command<'a>
Sourcepub fn args<I: IntoIterator>(&mut self, args: I) -> &mut Self
pub fn args<I: IntoIterator>(&mut self, args: I) -> &mut Self
Adds multiple arguments to the command.
Sourcepub fn current_dir(&mut self, dir: impl AsRef<str>) -> &mut Self
pub fn current_dir(&mut self, dir: impl AsRef<str>) -> &mut Self
Sets the current working directory for the command.
Sourcepub fn env_clear(&mut self) -> &mut Self
pub fn env_clear(&mut self) -> &mut Self
Clears the environment before setting the new environment.
Sourcepub fn env(
&mut self,
name: impl AsRef<str>,
value: impl AsRef<str>,
) -> &mut Self
pub fn env( &mut self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> &mut Self
Sets an environment variable for the command.
Sourcepub fn env_remove(&mut self, name: impl AsRef<str>) -> &mut Self
pub fn env_remove(&mut self, name: impl AsRef<str>) -> &mut Self
Removes an environment variable for the command.
Sourcepub fn stdout(&mut self, stdout: impl Into<Stdio>) -> &mut Self
pub fn stdout(&mut self, stdout: impl Into<Stdio>) -> &mut Self
Sets the stdout for the command.
Sourcepub fn stderr(&mut self, stderr: impl Into<Stdio>) -> &mut Self
pub fn stderr(&mut self, stderr: impl Into<Stdio>) -> &mut Self
Sets the stderr for the command.
Auto Trait Implementations§
impl<'a> Freeze for Command<'a>
impl<'a> !RefUnwindSafe for Command<'a>
impl<'a> Send for Command<'a>
impl<'a> Sync for Command<'a>
impl<'a> Unpin for Command<'a>
impl<'a> !UnwindSafe for Command<'a>
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