pub struct Command { /* private fields */ }Expand description
Structured description of an external command to run.
Command stores a program and argument vector instead of parsing a
shell-like command line. This avoids quoting ambiguity and accidental shell
injection. Use Self::shell only when shell parsing, redirection,
expansion, or pipes are intentionally required.
§Author
Haixing Hu
Implementations§
Source§impl Command
impl Command
Sourcepub fn working_directory<P>(self, working_directory: P) -> Self
pub fn working_directory<P>(self, working_directory: P) -> Self
Sourcepub fn working_directory_override(&self) -> Option<&Path>
pub fn working_directory_override(&self) -> Option<&Path>
Returns the per-command working directory override.
§Returns
Some(path) when the command has a working directory override, or
None when the runner default should be used.
Sourcepub fn environment(&self) -> &[(OsString, OsString)]
pub fn environment(&self) -> &[(OsString, OsString)]
Returns environment variable overrides.
§Returns
Borrowed environment variable entries in insertion order.
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin 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