pub struct Compilation<'cfg> {
    pub tests: Vec<UnitOutput>,
    pub binaries: Vec<UnitOutput>,
    pub cdylibs: Vec<UnitOutput>,
    pub native_dirs: BTreeSet<PathBuf>,
    pub root_output: HashMap<CompileKind, PathBuf>,
    pub deps_output: HashMap<CompileKind, PathBuf>,
    pub extra_env: HashMap<Metadata, Vec<(String, String)>>,
    pub to_doc_test: Vec<Doctest>,
    pub host: String,
    /* private fields */
}
Expand description

A structure returning the result of a compilation.

Fields

tests: Vec<UnitOutput>

An array of all tests created during this compilation.

binaries: Vec<UnitOutput>

An array of all binaries created.

cdylibs: Vec<UnitOutput>

An array of all cdylibs created.

native_dirs: BTreeSet<PathBuf>

All directories for the output of native build commands.

This is currently used to drive some entries which are added to the LD_LIBRARY_PATH as appropriate.

The order should be deterministic.

root_output: HashMap<CompileKind, PathBuf>

Root output directory (for the local package’s artifacts)

deps_output: HashMap<CompileKind, PathBuf>

Output directory for rust dependencies. May be for the host or for a specific target.

extra_env: HashMap<Metadata, Vec<(String, String)>>

Extra environment variables that were passed to compilations and should be passed to future invocations of programs.

The key is the build script metadata for uniquely identifying the RunCustomBuild unit that generated these env vars.

to_doc_test: Vec<Doctest>

Libraries to test with rustdoc.

host: String

The target host triple.

Implementations

Returns a ProcessBuilder for running rustc.

is_primary is true if this is a “primary package”, which means it was selected by the user on the command-line (such as with a -p flag), see crate::core::compiler::Context::primary_packages.

is_workspace is true if this is a workspace member.

Returns a ProcessBuilder for running rustdoc.

Returns a ProcessBuilder appropriate for running a process for the host platform.

This is currently only used for running build scripts. If you use this for anything else, please be extra careful on how environment variables are set!

Returns a ProcessBuilder appropriate for running a process for the target platform. This is typically used for cargo run and cargo test.

script_meta is the metadata for the RunCustomBuild unit that this unit used for its build script. Use None if the package did not have a build script.

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.

Should always be Self

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.