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>, (PathBuf, Vec<String>)>,
    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>>,
    // some fields omitted
}

Fields

Methods

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

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

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

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.

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

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

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

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

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

Return the host triple for this context

Return the target triple which this context is targeting.

Requested (not actual) target for the build

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.

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)

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)

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

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.

Gets a package for the given package id.

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

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

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

Number of jobs specified for this build