Struct cargo::core::compiler::layout::Layout

source ·
pub struct Layout {
    root: PathBuf,
    dest: PathBuf,
    deps: PathBuf,
    build: PathBuf,
    artifact: PathBuf,
    incremental: PathBuf,
    fingerprint: PathBuf,
    examples: PathBuf,
    doc: PathBuf,
    tmp: PathBuf,
    _lock: FileLock,
}
Expand description

Contains the paths of all target output locations.

See module docs for more information.

Fields§

§root: PathBuf

The root directory: /path/to/target. If cross compiling: /path/to/target/$TRIPLE.

§dest: PathBuf

The final artifact destination: $root/debug (or release).

§deps: PathBuf

The directory with rustc artifacts: $dest/deps

§build: PathBuf

The directory for build scripts: $dest/build

§artifact: PathBuf

The directory for artifacts, i.e. binaries, cdylibs, staticlibs: $dest/deps/artifact

§incremental: PathBuf

The directory for incremental files: $dest/incremental

§fingerprint: PathBuf

The directory for fingerprints: $dest/.fingerprint

§examples: PathBuf

The directory for examples: $dest/examples

§doc: PathBuf

The directory for rustdoc output: $root/doc

§tmp: PathBuf

The directory for temporary data of integration tests and benches: $dest/tmp

§_lock: FileLock

The lockfile for a build (.cargo-lock). Will be unlocked when this struct is dropped.

Implementations§

Calculate the paths for build output, lock the build directory, and return as a Layout.

This function will block if the directory is already locked.

dest should be the final artifact directory name. Currently either “debug” or “release”.

Makes sure all directories stored in the Layout exist on the filesystem.

Fetch the destination path for final artifacts (/…/target/debug).

Fetch the deps path.

Fetch the examples path.

Fetch the doc path.

Fetch the root path (/…/target).

Fetch the incremental path.

Fetch the fingerprint path.

Fetch the build script path.

Fetch the artifact path.

Create and return the tmp path.

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: 272 bytes