Skip to main content

PlanRequest

Struct PlanRequest 

Source
pub struct PlanRequest<'a> {
Show 15 fields pub graph: &'a PackageGraph, pub toolchain: &'a ResolvedToolchain, pub build_flags: &'a HashMap<usize, ResolvedProfileFlags>, pub language_standards: &'a HashMap<usize, ResolvedLanguageStandards>, pub standard_flag_conflicts: &'a HashMap<usize, Vec<StandardFlagConflict>>, pub build_dir: PathBuf, pub profile: ResolvedProfile, pub selected: Option<Vec<ManifestTargetSelector>>, pub configuration: Option<&'a BuildConfiguration>, pub selected_packages: Option<&'a [usize]>, pub compiler_wrapper: Option<&'a ResolvedCompilerWrapper>, pub dialect: Dialect, pub msvc_external_includes: bool, pub enabled_features: Option<&'a HashMap<usize, BTreeSet<String>>>, pub standard_compat: bool,
}
Expand description

Inputs to the build planner.

Fields§

§graph: &'a PackageGraph§toolchain: &'a ResolvedToolchain

Resolved C/C++ toolchain. The planner picks the compile driver per source language (toolchain.cc.path() for .c, toolchain.cxx.path() for .cc / .cpp / .cxx / .c++ / .C) and the link driver per target (C++ if any linked object came from a C++ source, otherwise C). toolchain.ar.path() drives archive commands.

§build_flags: &'a HashMap<usize, ResolvedProfileFlags>

Per-package resolved build flags. Missing entries fall back to an empty ResolvedProfileFlags; the planner does not require every package to be present so consumers can resolve flags lazily for the selected closure only.

§language_standards: &'a HashMap<usize, ResolvedLanguageStandards>

Per-package effective language standards. Missing entries resolve to no package-level standards, mirroring build_flags; a compile of a language with no effective standard is then rejected at its compile site.

§standard_flag_conflicts: &'a HashMap<usize, Vec<StandardFlagConflict>>

Per-package standard-flag conflict candidates, detected by the CLI on the manifest-derived flags before env / pkg-config augmentation (so CFLAGS / CXXFLAGS stay exempt). The planner records a violation for each planned compile a candidate’s scope covers; candidates whose scope is never planned (an unbuilt sibling target) gate nothing.

§build_dir: PathBuf

Absolute path under which all build outputs are placed.

§profile: ResolvedProfile

Resolved build profile. Drives compile flags and the per- profile output directory.

§selected: Option<Vec<ManifestTargetSelector>>

Specific manifest targets to build, plus their transitive deps. None means “every C/C++ target in every primary package”.

§configuration: Option<&'a BuildConfiguration>

Resolved root-package configuration. Carried through the planner so future cache logic and any planner-level fingerprint comparisons see the same selection the build script and metadata observed. The planner does not yet change C++ flags based on this value.

§selected_packages: Option<&'a [usize]>

Indices of graph.packages that the user picked through workspace package-selection flags. None means “use the graph’s primary set” (the documented default). When Some, default-target enumeration narrows to the supplied indices and any manifest-target selectors in selected are validated against them so an unrelated package never sneaks into the build.

§compiler_wrapper: Option<&'a ResolvedCompilerWrapper>

Optional compiler wrapper applied to every C and C++ compile command. The Ninja command field is prefixed with the wrapper executable; the matching compile_commands.json arguments array stays unwrapped so clangd / IDE tooling keeps seeing the underlying compiler. Link and archive commands are never wrapped.

§dialect: Dialect

Compiler command-line dialect for this build. Selected from the detected C++ compiler (MSVC drives the cl.exe dialect). Governs artifact naming (.o vs .obj, lib<x>.a vs <x>.lib, <x> vs <x>.exe) and the spelling of every compile / archive / link command the lowering emits.

§msvc_external_includes: bool

Whether the MSVC-dialect compilers accept the /external:I block (crate::msvc_external_includes_supported). When false on an MSVC build, the planner collapses the system include bucket into the plain /I list instead of emitting a switch an old cl would reject. Ignored by the GCC/Clang dialect, where -isystem is part of the base command line.

§enabled_features: Option<&'a HashMap<usize, BTreeSet<String>>>

Per-package enabled feature names from the cross-package feature resolver, keyed by graph.packages index. Gates targets that declare required-features: default enumeration skips a target whose required features are not all enabled, while naming one explicitly (a selector or a deps entry) is a hard error. None (and missing entries) mean “no features enabled” for gating purposes.

§standard_compat: bool

Whether the post-resolution standard-compatibility check runs over the resolved target graph (crate::standard_compat). The build / check / run / test commands set it; cabin tidy leaves it false, and then the planner records no violations and its output is unchanged.

Trait Implementations§

Source§

impl<'a> Debug for PlanRequest<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for PlanRequest<'a>

§

impl<'a> RefUnwindSafe for PlanRequest<'a>

§

impl<'a> Send for PlanRequest<'a>

§

impl<'a> Sync for PlanRequest<'a>

§

impl<'a> Unpin for PlanRequest<'a>

§

impl<'a> UnsafeUnpin for PlanRequest<'a>

§

impl<'a> UnwindSafe for PlanRequest<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V