pub struct ConditionContext<'a> {
pub platform: &'a TargetPlatform,
pub features: &'a BTreeSet<String>,
pub cc: Option<&'a CompilerIdentity>,
pub cxx: Option<&'a CompilerIdentity>,
}Expand description
Evaluation context for Condition::evaluate. Bundles the
host platform, the owning package’s enabled-feature set, and
the detected compiler identities so each leaf kind reads the
input it is defined over. Platform-only call sites (dependency
gating, toolchain / wrapper selection) use
ConditionContext::platform_only; compiler identities are
attached only on the flag-resolution path, the only place
compiler-referencing leaves are reachable (the manifest layer
rejects them elsewhere).
Fields§
§platform: &'a TargetPlatform§features: &'a BTreeSet<String>§cc: Option<&'a CompilerIdentity>Detected C compiler identity, when detection has run and resolved a C compiler.
cxx: Option<&'a CompilerIdentity>Detected C++ compiler identity, when detection has run.
Implementations§
Source§impl<'a> ConditionContext<'a>
impl<'a> ConditionContext<'a>
Sourcepub fn platform_only(platform: &'a TargetPlatform) -> Self
pub fn platform_only(platform: &'a TargetPlatform) -> Self
Platform-only evaluation: no features, no detected compilers. Correct for dependency gating and toolchain / wrapper selection, where feature and compiler leaves are rejected at manifest-load time.
Sourcepub fn with_features(
platform: &'a TargetPlatform,
features: &'a BTreeSet<String>,
) -> Self
pub fn with_features( platform: &'a TargetPlatform, features: &'a BTreeSet<String>, ) -> Self
Platform + enabled-feature evaluation (no detected compilers attached yet).
Sourcepub fn with_compilers(
self,
cc: Option<&'a CompilerIdentity>,
cxx: Option<&'a CompilerIdentity>,
) -> Self
pub fn with_compilers( self, cc: Option<&'a CompilerIdentity>, cxx: Option<&'a CompilerIdentity>, ) -> Self
Attach detected compiler identities (flag-resolution path).
Sourcepub fn identity(&self, slot: CompilerSlot) -> Option<&'a CompilerIdentity>
pub fn identity(&self, slot: CompilerSlot) -> Option<&'a CompilerIdentity>
Detected identity for slot, when available.
Trait Implementations§
Source§impl<'a> Clone for ConditionContext<'a>
impl<'a> Clone for ConditionContext<'a>
Source§fn clone(&self) -> ConditionContext<'a>
fn clone(&self) -> ConditionContext<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more