Struct escargot::CargoRun

source ·
pub struct CargoRun { /* private fields */ }
Expand description

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.

Relevant features

  • print for logged output to be printed instead, generally for test writing.

Example

let run = escargot::CargoBuild::new()
    .bin("bin_fixture")
    .current_release()
    .current_target()
    .run()
    .unwrap();
println!("artifact={}", run.path().display());

Implementations

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

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.