pub struct CommandSpec {
pub program: OsString,
pub args: Vec<OsString>,
pub cwd: Option<PathBuf>,
}Expand description
One command waiting to be executed, pure data – a plugin only describes “what to run” and the
actual spawn is done by the host, so stdio, environment, and exit-code handling have exactly
one implementation. Construction is a consuming chain (self -> Self), so it can produce a
value directly:
ⓘ
let spec = CommandSpec::new("cargo").arg("add").args(args.iter()).cwd("/somewhere");Fields§
§program: OsStringExecutable. It may be a bare name (resolved on PATH), an absolute path, or a path
relative to this spec’s cwd – which is the project root when the
spec does not name one. On Windows a bare name resolves through PATHEXT, so pnpm finds
pnpm.cmd, and the host starts a batch file the way the platform requires.
args: Vec<OsString>Arguments, in order.
cwd: Option<PathBuf>Working-directory override. None = use the project root given by the host.
Implementations§
Source§impl CommandSpec
impl CommandSpec
Trait Implementations§
Source§impl Clone for CommandSpec
impl Clone for CommandSpec
Source§impl Debug for CommandSpec
impl Debug for CommandSpec
impl Eq for CommandSpec
Source§impl PartialEq for CommandSpec
impl PartialEq for CommandSpec
impl StructuralPartialEq for CommandSpec
Auto Trait Implementations§
impl Freeze for CommandSpec
impl RefUnwindSafe for CommandSpec
impl Send for CommandSpec
impl Sync for CommandSpec
impl Unpin for CommandSpec
impl UnsafeUnpin for CommandSpec
impl UnwindSafe for CommandSpec
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