[][src]Struct cargo::core::compiler::BuildContext

pub struct BuildContext<'a, 'cfg: 'a> {
    pub ws: &'a Workspace<'cfg>,
    pub config: &'cfg Config,
    pub resolve: &'a Resolve,
    pub profiles: &'a Profiles,
    pub build_config: &'a BuildConfig,
    pub extra_compiler_args: HashMap<Unit<'a>, Vec<String>>,
    pub packages: &'a PackageSet<'cfg>,
    pub rustc: Rustc,
    pub host_config: TargetConfig,
    pub target_config: TargetConfig,
    pub target_info: TargetInfo,
    pub host_info: TargetInfo,
    pub incremental_env: Option<bool>,
}

The build context, containing all information about a build task

Fields

ws: &'a Workspace<'cfg>

The workspace the build is for

config: &'cfg Config

The cargo configuration

resolve: &'a Resolve

The dependency graph for our build

profiles: &'a Profilesbuild_config: &'a BuildConfigextra_compiler_args: HashMap<Unit<'a>, Vec<String>>

Extra compiler args for either rustc or rustdoc.

packages: &'a PackageSet<'cfg>rustc: Rustc

Information about the compiler

host_config: TargetConfig

Build information for the host arch

target_config: TargetConfig

Build information for the target

target_info: TargetInfohost_info: TargetInfoincremental_env: Option<bool>

Methods

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

pub fn new(
    ws: &'a Workspace<'cfg>,
    resolve: &'a Resolve,
    packages: &'a PackageSet<'cfg>,
    config: &'cfg Config,
    build_config: &'a BuildConfig,
    profiles: &'a Profiles,
    extra_compiler_args: HashMap<Unit<'a>, Vec<String>>
) -> CargoResult<BuildContext<'a, 'cfg>>
[src]

pub fn extern_crate_name(
    &self,
    unit: &Unit<'a>,
    dep: &Unit<'a>
) -> CargoResult<String>
[src]

pub fn dep_platform_activated(&self, dep: &Dependency, kind: Kind) -> bool[src]

Whether a dependency should be compiled for the host or target platform, specified by Kind.

pub fn linker(&self, kind: Kind) -> Option<&Path>[src]

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

pub fn ar(&self, kind: Kind) -> Option<&Path>[src]

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

pub fn cfg(&self, kind: Kind) -> &[Cfg][src]

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

pub fn host_triple(&self) -> &str[src]

The host arch triple

e.g. x86_64-unknown-linux-gnu, would be

  • machine: x86_64
  • hardware-platform: unknown
  • operating system: linux-gnu

pub fn target_triple(&self) -> &str[src]

pub fn jobs(&self) -> u32[src]

Number of jobs specified for this build

pub fn rustflags_args(&self, unit: &Unit) -> CargoResult<Vec<String>>[src]

pub fn rustdocflags_args(&self, unit: &Unit) -> CargoResult<Vec<String>>[src]

pub fn show_warnings(&self, pkg: PackageId) -> bool[src]

pub fn extra_args_for(&self, unit: &Unit<'a>) -> Option<&Vec<String>>[src]

Auto Trait Implementations

impl<'a, 'cfg> !Send for BuildContext<'a, 'cfg>

impl<'a, 'cfg> !Sync for BuildContext<'a, 'cfg>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self