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

pub struct Context<'a, 'cfg: 'a> {
    pub bcx: &'a BuildContext<'a, 'cfg>,
    pub compilation: Compilation<'cfg>,
    pub build_state: Arc<BuildState>,
    pub build_script_overridden: HashSet<(PackageId, Kind)>,
    pub build_explicit_deps: HashMap<Unit<'a>, BuildDeps>,
    pub fingerprints: HashMap<Unit<'a>, Arc<Fingerprint>>,
    pub compiled: HashSet<Unit<'a>>,
    pub build_scripts: HashMap<Unit<'a>, Arc<BuildScripts>>,
    pub links: Links,
    pub jobserver: Client,
    // some fields omitted
}

Fields

bcx: &'a BuildContext<'a, 'cfg>compilation: Compilation<'cfg>build_state: Arc<BuildState>build_script_overridden: HashSet<(PackageId, Kind)>build_explicit_deps: HashMap<Unit<'a>, BuildDeps>fingerprints: HashMap<Unit<'a>, Arc<Fingerprint>>compiled: HashSet<Unit<'a>>build_scripts: HashMap<Unit<'a>, Arc<BuildScripts>>links: Linksjobserver: Client

Methods

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

pub fn new(
    config: &'cfg Config,
    bcx: &'a BuildContext<'a, 'cfg>
) -> CargoResult<Self>
[src]

pub fn compile(
    self,
    units: &[Unit<'a>],
    export_dir: Option<PathBuf>,
    exec: &Arc<dyn Executor>
) -> CargoResult<Compilation<'cfg>>
[src]

pub fn get_executable(
    &mut self,
    unit: &Unit<'a>
) -> CargoResult<Option<PathBuf>>
[src]

Returns the executable for the specified unit (if any).

pub fn prepare_units(
    &mut self,
    export_dir: Option<PathBuf>,
    units: &[Unit<'a>]
) -> CargoResult<()>
[src]

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]

Return the filenames that the given unit will generate.

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

For a package, return all targets which are registered as dependencies for that package.

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

pub fn is_primary_package(&self, unit: &Unit<'a>) -> bool[src]

pub fn get_package(&self, id: PackageId) -> CargoResult<&'a Package>[src]

Gets a package for the given package id.

pub fn build_plan_inputs(&self) -> CargoResult<Vec<PathBuf>>[src]

Return the list of filenames read by cargo to generate the BuildContext (all Cargo.toml, etc).

Auto Trait Implementations

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

impl<'a, 'cfg> !Sync for Context<'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