pub struct CompilationFiles<'a, 'cfg> {
    pub(super) host: Layout,
    pub(super) target: HashMap<CompileTarget, Layout>,
    export_dir: Option<PathBuf>,
    roots: Vec<Unit>,
    ws: &'a Workspace<'cfg>,
    metas: HashMap<Unit, MetaInfo>,
    outputs: HashMap<Unit, LazyCell<Arc<Vec<OutputFile>>>>,
}
Expand description

Collection of information about the files emitted by the compiler, and the output directory structure.

Fields§

§host: Layout

The target directory layout for the host (and target if it is the same as host).

§target: HashMap<CompileTarget, Layout>

The target directory layout for the target (if different from then host).

§export_dir: Option<PathBuf>

Additional directory to include a copy of the outputs.

§roots: Vec<Unit>

The root targets requested by the user on the command line (does not include dependencies).

§ws: &'a Workspace<'cfg>§metas: HashMap<Unit, MetaInfo>

Metadata hash to use for each unit.

§outputs: HashMap<Unit, LazyCell<Arc<Vec<OutputFile>>>>

For each Unit, a list all files produced.

Implementations§

Returns the appropriate directory layout for either a plugin or not.

Gets the metadata for the given unit.

See module docs for more details.

Returns whether or not -C extra-filename is used to extend the output filenames to make them unique.

Gets the short hash based only on the PackageId. Used for the metadata when metadata returns None.

Returns the directory where the artifacts for the given unit are initially created.

Additional export directory from --out-dir.

Directory name to use for a package in the form NAME-HASH.

Note that some units may share the same directory, so care should be taken in those cases!

Returns the final artifact path for the host (/…/target/debug)

Returns the root of the build output tree for the host (/…/target)

Returns the host deps directory path.

Returns the directories where Rust crate dependencies are found for the specified unit.

Directory where the fingerprint for the given unit should go.

Returns the path for a file in the fingerprint directory.

The “prefix” should be something to distinguish the file from other files in the fingerprint directory.

Path where compiler output is cached.

Returns the directory where a compiled build script is stored. /path/to/target/{debug,release}/build/PKG-HASH

Returns the directory for compiled artifacts files. /path/to/target/{debug,release}/deps/artifact/KIND/PKG-HASH

Returns the directory where information about running a build script is stored. /path/to/target/{debug,release}/build/PKG-HASH

Returns the “OUT_DIR” directory for running a build script. /path/to/target/{debug,release}/build/PKG-HASH/out

Returns the path to the executable binary for the given bin target.

This should only to be used when a Unit is not available.

Returns the filenames that the given unit will generate.

Note: It is not guaranteed that all of the files will be generated.

Returns the path where the output for the given unit and FileType should be uplifted to.

Returns None if the unit shouldn’t be uplifted (for example, a dependent rlib).

Computes the actual, full pathnames for all the files generated by rustc.

The OutputFile also contains the paths where those files should be “uplifted” to.

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.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 472 bytes