[][src]Struct rustwide::Build

pub struct Build<'b> { /* fields omitted */ }

API to interact with a running build.

This is created from BuildDirectory::build

Implementations

impl<'_> Build<'_>[src]

pub fn cmd<R: Runnable>(&self, bin: R) -> Command[src]

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

pub fn cargo(&self) -> Command[src]

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

pub fn host_source_dir(&self) -> PathBuf[src]

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

pub fn host_target_dir(&self) -> PathBuf[src]

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

Auto Trait Implementations

impl<'b> !RefUnwindSafe for Build<'b>

impl<'b> Send for Build<'b>

impl<'b> Sync for Build<'b>

impl<'b> Unpin for Build<'b>

impl<'b> !UnwindSafe for Build<'b>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,