Struct cargo::core::compiler::Context [−][src]
Collection of all the stuff that is needed to perform a build.
Fields
bcx: &'a BuildContext<'a, 'cfg>
Mostly static information about the build task.
compilation: Compilation<'cfg>
A large collection of information about the result of the entire compilation.
build_script_outputs: Arc<Mutex<BuildScriptOutputs>>
Output from build scripts, updated after each build script runs.
build_explicit_deps: HashMap<Unit<'a>, BuildDeps>
Dependencies (like rerun-if-changed) declared by a build script. This is only populated from the output from previous runs. If the build script hasn’t ever been run, then it must be run.
fingerprints: HashMap<Unit<'a>, Arc<Fingerprint>>
Fingerprints used to detect if a unit is out-of-date.
mtime_cache: HashMap<PathBuf, FileTime>
Cache of file mtimes to reduce filesystem hits.
compiled: HashSet<Unit<'a>>
A set used to track which units have been compiled. A unit may appear in the job graph multiple times as a dependency of multiple packages, but it only needs to run once.
build_scripts: HashMap<Unit<'a>, Arc<BuildScripts>>
Linking information for each Unit
.
See build_map
for details.
jobserver: Client
Job server client to manage concurrency with other processes.
Implementations
impl<'a, 'cfg> Context<'a, 'cfg>
[src]
pub fn new(
config: &'cfg Config,
bcx: &'a BuildContext<'a, 'cfg>,
unit_dependencies: UnitGraph<'a>,
default_kind: CompileKind
) -> CargoResult<Self>
[src]
config: &'cfg Config,
bcx: &'a BuildContext<'a, 'cfg>,
unit_dependencies: UnitGraph<'a>,
default_kind: CompileKind
) -> CargoResult<Self>
pub fn compile(
self,
units: &[Unit<'a>],
export_dir: Option<PathBuf>,
exec: &Arc<dyn Executor>
) -> CargoResult<Compilation<'cfg>>
[src]
self,
units: &[Unit<'a>],
export_dir: Option<PathBuf>,
exec: &Arc<dyn Executor>
) -> CargoResult<Compilation<'cfg>>
pub fn get_executable(
&mut self,
unit: &Unit<'a>
) -> CargoResult<Option<PathBuf>>
[src]
&mut self,
unit: &Unit<'a>
) -> CargoResult<Option<PathBuf>>
Returns the executable for the specified unit (if any).
pub fn prepare_units(
&mut self,
export_dir: Option<PathBuf>,
units: &[Unit<'a>]
) -> CargoResult<()>
[src]
&mut self,
export_dir: Option<PathBuf>,
units: &[Unit<'a>]
) -> CargoResult<()>
pub fn prepare(&mut self) -> CargoResult<()>
[src]
Prepare this context, ensuring that all filesystem directories are in place.
pub fn files(&self) -> &CompilationFiles<'a, 'cfg>
[src]
pub fn outputs(&self, unit: &Unit<'a>) -> CargoResult<Arc<Vec<OutputFile>>>
[src]
Returns the filenames that the given unit will generate.
pub fn unit_deps(&self, unit: &Unit<'a>) -> &[UnitDep<'a>]
[src]
Direct dependencies for the given unit.
pub fn is_primary_package(&self, unit: &Unit<'a>) -> bool
[src]
pub fn build_plan_inputs(&self) -> CargoResult<Vec<PathBuf>>
[src]
Returns the list of filenames read by cargo to generate the BuildContext
(all Cargo.toml
, etc.).
pub fn only_requires_rmeta(&self, parent: &Unit<'a>, dep: &Unit<'a>) -> bool
[src]
Returns whether when parent
depends on dep
if it only requires the
metadata file from dep
.
pub fn rmeta_required(&self, unit: &Unit<'a>) -> bool
[src]
Returns whether when unit
is built whether it should emit metadata as
well because some compilations rely on that.
Auto Trait Implementations
impl<'a, 'cfg> !RefUnwindSafe for Context<'a, 'cfg>
impl<'a, 'cfg> !Send for Context<'a, 'cfg>
impl<'a, 'cfg> !Sync for Context<'a, 'cfg>
impl<'a, 'cfg> Unpin for Context<'a, 'cfg> where
'cfg: 'a,
'cfg: 'a,
impl<'a, 'cfg> !UnwindSafe for Context<'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>,