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. The host resolves it to a real path with which and decides per platform
whether to wrap it in cmd /C (on Windows pnpm is really pnpm.cmd, and spawning it
directly fails).
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