Struct cargo::core::compiler::BuildContext [−][src]
The build context, containing all information about a build task.
It is intended that this is mostly static information. Stuff that mutates
during the build can be found in the parent Context
. (I say mostly,
because this has internal caching, but nothing that should be observable
or require &mut.)
Fields
ws: &'a Workspace<'cfg>
The workspace the build is for.
config: &'cfg Config
The cargo configuration.
profiles: &'a Profiles
build_config: &'a BuildConfig
extra_compiler_args: HashMap<Unit<'a>, Vec<String>>
Extra compiler args for either rustc
or rustdoc
.
packages: &'a PackageSet<'cfg>
units: &'a UnitInterner<'a>
Source of interning new units as they’re created.
rustc: Rustc
Information about the compiler that we’ve detected on the local system.
Implementations
impl<'a, 'cfg> BuildContext<'a, 'cfg>
[src]
pub fn new(
ws: &'a Workspace<'cfg>,
packages: &'a PackageSet<'cfg>,
config: &'cfg Config,
build_config: &'a BuildConfig,
profiles: &'a Profiles,
units: &'a UnitInterner<'a>,
extra_compiler_args: HashMap<Unit<'a>, Vec<String>>
) -> CargoResult<BuildContext<'a, 'cfg>>
[src]
ws: &'a Workspace<'cfg>,
packages: &'a PackageSet<'cfg>,
config: &'cfg Config,
build_config: &'a BuildConfig,
profiles: &'a Profiles,
units: &'a UnitInterner<'a>,
extra_compiler_args: HashMap<Unit<'a>, Vec<String>>
) -> CargoResult<BuildContext<'a, 'cfg>>
pub fn dep_platform_activated(
&self,
dep: &Dependency,
kind: CompileKind
) -> bool
[src]
&self,
dep: &Dependency,
kind: CompileKind
) -> bool
Whether a dependency should be compiled for the host or target platform,
specified by CompileKind
.
pub fn linker(&self, kind: CompileKind) -> Option<&Path>
[src]
Gets the user-specified linker for a particular host or target.
pub fn ar(&self, kind: CompileKind) -> Option<&Path>
[src]
Gets the user-specified ar
program for a particular host or target.
pub fn cfg(&self, kind: CompileKind) -> &[Cfg]
[src]
Gets the list of cfg
s printed out from the compiler for the specified kind.
pub fn host_triple(&self) -> InternedString
[src]
Gets the host architecture triple.
For example, x86_64-unknown-linux-gnu, would be
- machine: x86_64,
- hardware-platform: unknown,
- operating system: linux-gnu.
pub fn target_config(&self, kind: CompileKind) -> &TargetConfig
[src]
Gets the target configuration for a particular host or target.
pub fn jobs(&self) -> u32
[src]
Gets the number of jobs specified for this build.
pub fn rustflags_args(&self, unit: &Unit<'_>) -> &[String]
[src]
pub fn rustdocflags_args(&self, unit: &Unit<'_>) -> &[String]
[src]
pub fn show_warnings(&self, pkg: PackageId) -> bool
[src]
pub fn info(&self, kind: CompileKind) -> &TargetInfo
[src]
pub fn extra_args_for(&self, unit: &Unit<'a>) -> Option<&Vec<String>>
[src]
pub fn script_override(
&self,
lib_name: &str,
kind: CompileKind
) -> Option<&BuildOutput>
[src]
&self,
lib_name: &str,
kind: CompileKind
) -> Option<&BuildOutput>
If a build script is overridden, this returns the BuildOutput
to use.
lib_name
is the links
library name and kind
is whether it is for
Host or Target.
Auto Trait Implementations
impl<'a, 'cfg> !RefUnwindSafe for BuildContext<'a, 'cfg>
impl<'a, 'cfg> !Send for BuildContext<'a, 'cfg>
impl<'a, 'cfg> !Sync for BuildContext<'a, 'cfg>
impl<'a, 'cfg> Unpin for BuildContext<'a, 'cfg> where
'cfg: 'a,
'cfg: 'a,
impl<'a, 'cfg> !UnwindSafe for BuildContext<'a, 'cfg>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,