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 env_remove(&mut self, key: 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.
Auto Trait Implementations§
impl Freeze for CommandBuilder
impl !RefUnwindSafe for CommandBuilder
impl Send for CommandBuilder
impl Sync for CommandBuilder
impl Unpin for CommandBuilder
impl !UnwindSafe for CommandBuilder
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