Struct escargot::CargoRun [−][src]
pub struct CargoRun { /* fields omitted */ }
The run
subcommand (emulated).
Created via CargoBuild::run
.
Benefits over spawning cargo run
:
- Able to cache binary path, avoiding cargo overhead.
- Independent of CWD.
- stdout/stderr are clean of
cargo run
output.
Example
let run = escargot::CargoBuild::new() .bin("bin_fixture") .current_release() .current_target() .run() .unwrap(); println!("artifact={}", run.path().display());
Methods
impl CargoRun
[src]
impl CargoRun
pub fn path(&self) -> &Path
[src]
pub fn path(&self) -> &Path
Path to the specified binary.
This is to support alternative ways of launching the binary besides [Command
].
Example
let run = escargot::CargoBuild::new() .bin("bin_fixture") .current_release() .current_target() .run() .unwrap(); println!("artifact={}", run.path().display());
or
let run = escargot::CargoBuild::new() .example("example_fixture") .current_release() .current_target() .run() .unwrap(); println!("artifact={}", run.path().display());
pub fn command(&self) -> Command
[src]
pub fn command(&self) -> Command
Run the build artifact.