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).