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]

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());

Run the build artifact.

Auto Trait Implementations

impl Send for CargoRun

impl Sync for CargoRun