Struct cargo::ops::Context [] [src]

pub struct Context<'a, 'cfg: 'a> {
    pub ws: &'a Workspace<'cfg>,
    pub config: &'cfg Config,
    pub resolve: &'a Resolve,
    pub compilation: Compilation<'cfg>,
    pub packages: &'a PackageSet<'cfg>,
    pub build_state: Arc<BuildState>,
    pub build_explicit_deps: HashMap<Unit<'a>, BuildDeps>,
    pub fingerprints: HashMap<Unit<'a>, Arc<Fingerprint>>,
    pub compiled: HashSet<Unit<'a>>,
    pub build_config: BuildConfig,
    pub build_scripts: HashMap<Unit<'a>, Arc<BuildScripts>>,
    pub links: Links<'a>,
    pub used_in_plugin: HashSet<Unit<'a>>,
    pub jobserver: Client,
    // some fields omitted
}

Fields

Methods

impl<'a, 'cfg> Context<'a, 'cfg>
[src]

[src]

[src]

Prepare this context, ensuring that all filesystem directories are in place.

[src]

Ensure that we've collected all target-specific information to compile all the units mentioned in units.

[src]

Builds up the used_in_plugin internal to this context from the list of top-level units.

This will recursively walk units and all of their dependencies to determine which crate are going to be used in plugins or not.

[src]

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

[src]

Returns the directory for the specified unit where fingerprint information is stored.

[src]

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

[src]

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

[src]

[src]

Return the root of the build output tree

[src]

Returns the appropriate output directory for the specified package and target.

[src]

Return the host triple for this context

[src]

Return the target triple which this context is targeting.

[src]

Requested (not actual) target for the build

[src]

Get the short hash based only on the PackageId Used for the metadata when target_metadata returns None

[src]

Get the metadata for a target in a specific profile We build to the path: "{filename}-{target_metadata}" We use a linking step to link/copy to a predictable filename like target/debug/libfoo.{a,so,rlib} and such.

[src]

Returns the file stem for a given target/profile combo (with metadata)

Returns a tuple with the directory and name of the hard link we expect our target to be copied to. Eg, file_stem may be out_dir/deps/foo-abcdef and link_stem would be out_dir/foo This function returns it in two parts so the caller can add prefix/suffix to filename separately Returns an Option because in some cases we don't want to link (eg a dependent lib)

[src]

Return the filenames that the given target for the given profile will generate as a list of 3-tuples (filename, link_dst, linkable) filename: filename rustc compiles to. (Often has metadata suffix). link_dst: Optional file to link/copy the result to (without metadata suffix) linkable: Whether possible to link against file (eg it's a library)

[src]

For a package, return all targets which are registered as dependencies for that package.

[src]

Returns the dependencies needed to run a build script.

The unit provided must represent an execution of a build script, and the returned set of units must all be run before unit is run.

[src]

Gets a package for the given package id.

[src]

Get the user-specified linker for a particular host or target

[src]

Get the user-specified ar program for a particular host or target

[src]

Get the list of cfg printed out from the compiler for the specified kind

[src]

Number of jobs specified for this build

[src]

[src]

[src]

[src]

[src]

[src]

[src]