pub struct Invocation { /* private fields */ }Expand description
A program invocation: what to run, with which arguments, and where.
use odx_core::Invocation;
let git = Invocation::new("git").arg("status").current_dir("/tmp");
assert_eq!(git.program(), "git");
assert_eq!(git.arguments(), ["status"]);Implementations§
Source§impl Invocation
impl Invocation
Sourcepub fn new(program: impl Into<OsString>) -> Self
pub fn new(program: impl Into<OsString>) -> Self
Start an invocation of program with no arguments.
Sourcepub fn env(self, key: impl Into<OsString>, value: impl Into<OsString>) -> Self
pub fn env(self, key: impl Into<OsString>, value: impl Into<OsString>) -> Self
Set an environment variable for the process.
Sourcepub fn current_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn current_dir(self, dir: impl Into<PathBuf>) -> Self
Run in dir instead of the current directory.
Sourcepub fn working_dir(&self) -> Option<&PathBuf>
pub fn working_dir(&self) -> Option<&PathBuf>
The working directory, if one was set.
Trait Implementations§
Source§impl Clone for Invocation
impl Clone for Invocation
Source§impl Debug for Invocation
impl Debug for Invocation
impl Eq for Invocation
Source§impl PartialEq for Invocation
impl PartialEq for Invocation
impl StructuralPartialEq for Invocation
Auto Trait Implementations§
impl Freeze for Invocation
impl RefUnwindSafe for Invocation
impl Send for Invocation
impl Sync for Invocation
impl Unpin for Invocation
impl UnsafeUnpin for Invocation
impl UnwindSafe for Invocation
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