Struct cargo::ops::Context
[−]
[src]
pub struct Context<'a, 'cfg> { pub config: &'cfg Config, pub resolve: &'a Resolve, pub sources: &'a SourceMap<'cfg>, pub compilation: Compilation<'cfg>, pub build_state: Arc<BuildState>, pub exec_engine: Arc<Box<ExecEngine>>, pub fingerprints: HashMap<Unit<'a>, Arc<Fingerprint>>, pub compiled: HashSet<Unit<'a>>, pub build_config: BuildConfig, pub build_scripts: HashMap<Unit<'a>, Arc<BuildScripts>>, // some fields omitted }
Fields
config | |
resolve | |
sources | |
compilation | |
build_state | |
exec_engine | |
fingerprints | |
compiled | |
build_config | |
build_scripts |
Methods
impl<'a, 'cfg> Context<'a, 'cfg>
fn new(resolve: &'a Resolve, sources: &'a SourceMap<'cfg>, deps: &'a PackageSet, config: &'cfg Config, host: Layout, target_layout: Option<Layout>, build_config: BuildConfig, profiles: &'a Profiles) -> CargoResult<Context<'a, 'cfg>>
fn prepare(&mut self, root: &Package) -> CargoResult<()>
Prepare this context, ensuring that all filesystem directories are in place.
fn layout(&self, pkg: &Package, kind: Kind) -> LayoutProxy
Returns the appropriate directory layout for either a plugin or not.
fn out_dir(&self, unit: &Unit) -> PathBuf
Returns the appropriate output directory for the specified package and target.
fn target_triple(&self) -> &str
Return the target triple which this context is targeting.
fn target_metadata(&self, unit: &Unit) -> Option<Metadata>
Get the metadata for a target in a specific profile
fn file_stem(&self, unit: &Unit) -> String
Returns the file stem for a given target/profile combo
fn target_filenames(&self, unit: &Unit) -> CargoResult<Vec<String>>
Return the filenames that the given target for the given profile will generate.
fn dep_targets(&self, unit: &Unit<'a>) -> Vec<Unit<'a>>
For a package, return all targets which are registered as dependencies for that package.
fn dep_run_custom_build(&self, unit: &Unit<'a>) -> Vec<Unit<'a>>
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.
fn get_package(&self, id: &PackageId) -> &'a Package
Gets a package for the given package id.
fn linker(&self, kind: Kind) -> Option<&Path>
Get the user-specified linker for a particular host or target
fn ar(&self, kind: Kind) -> Option<&Path>
Get the user-specified ar
program for a particular host or target
fn jobs(&self) -> u32
Number of jobs specified for this build
fn requested_target(&self) -> Option<&str>
Requested (not actual) target for the build