pub struct CommandBuilder { /* private fields */ }Expand description
Builder wrapper that centralizes direct usages of std::process::Command.
Implementations§
Source§impl CommandBuilder
impl CommandBuilder
pub fn new(program: impl AsRef<OsStr>) -> Self
pub fn arg(&mut self, arg: impl AsRef<OsStr>) -> &mut Self
pub fn args<S, I>(&mut self, args: I) -> &mut Self
pub fn env( &mut self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>, ) -> &mut Self
pub fn stdin_file(&mut self, file: File) -> &mut Self
pub fn current_dir(&mut self, dir: impl AsRef<Path>) -> &mut Self
pub fn status(&mut self) -> Result<ExitStatus>
pub fn output(&mut self) -> Result<CommandOutput>
pub fn spawn(&mut self) -> Result<ChildHandle>
Sourcepub fn snapshot(&self) -> CommandSnapshot
pub fn snapshot(&self) -> CommandSnapshot
Return a lightweight snapshot of the command configuration for testing.