Struct rustwide::Build[][src]

pub struct Build<'ws> { /* fields omitted */ }
Expand description

API to interact with a running build.

This is created from BuildDirectory::build

Implementations

Run a command inside the sandbox.

Any cargo invocation will automatically be configured to use a target directory mounted outside the sandbox. The crate’s source directory will be the working directory for the command.

Example

let mut build_dir = workspace.build_dir("foo");
build_dir.build(&toolchain, &krate, sandbox).run(|build| {
    build.cmd("rustfmt").args(&["--check", "src/main.rs"]).run()?;
    Ok(())
})?;

Run cargo inside the sandbox, using the toolchain chosen for the build.

cargo will automatically be configured to use a target directory mounted outside the sandbox. The crate’s source directory will be the working directory for the command.

Example

let mut build_dir = workspace.build_dir("foo");
build_dir.build(&toolchain, &krate, sandbox).run(|build| {
    build.cargo().args(&["test", "--all"]).run()?;
    Ok(())
})?;

Get the path to the source code on the host machine (outside the sandbox).

Get the path to the target directory on the host machine (outside the sandbox).

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

Performs the conversion.

Performs the conversion.

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.