Expand description
Typed model for cfg(...) target-condition expressions.
Cabin manifests can declare target-specific dependency tables, e.g.
[target.'cfg(os = "linux")'.dependencies]
epoll = "^1"The condition string between the parentheses is parsed into a
Condition AST and evaluated against a TargetPlatform
describing the current evaluation context (the host build
platform in this step). Parsing and evaluation are pure,
deterministic, and side-effect-free.
Supported keys are intentionally narrow — os, arch,
family, env, abi, target — and listed by the
ConditionKey enum. Any other key is rejected at parse
time so manifests do not silently rely on a future
detection layer.
Public syntax is preserved as the canonical inner-expression
string when round-tripped (see the Display impl on
Condition); the manifest layer wraps it in cfg(...) and
the metadata layer emits the bare inner form so JSON /
on-disk shapes stay compact.
Structs§
- Target
Platform - Evaluation context for
Condition::evaluate. Each field is a stable, normalized lowercase string. Unknown values flow through as the literalunknown, which is matchable incfg(...)expressions.
Enums§
- Condition
- Typed AST for a
cfg(...)target condition. - Condition
Key - Recognized target-condition keys. Anything else is rejected at parse time.
- Condition
Parse Error - Errors produced while parsing a
cfg(...)expression.