Struct cargo::ops::Context
[−]
[src]
pub struct Context<'a, 'cfg: 'a> { 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 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>>, pub links: Links<'a>, // some fields omitted }
Fields
config | |
resolve | |
compilation | |
packages | |
build_state | |
build_explicit_deps | |
exec_engine | |
fingerprints | |
compiled | |
build_config | |
build_scripts | |
links |
Methods
impl<'a, 'cfg> Context<'a, 'cfg>
[src]
fn new(resolve: &'a Resolve, packages: &'a PackageSet<'cfg>, 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 staticlib(&self, kind: Kind) -> CargoResult<(&str, &str)>
Return the (prefix, suffix) pair for static libraries.
If plugin
is true, the pair corresponds to the host platform,
otherwise it corresponds to the target platform.
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>) -> CargoResult<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>) -> CargoResult<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) -> CargoResult<&'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