macro_rules! require {
($spec:literal) => { ... };
}Expand description
require!(<spec>) — build a RequiredCapability from a
string-literal spec. Panics at construction on malformed input
(matches the substrate plan’s “validates shapes at parse time”
contract for the macro family).
§Forms
ⓘ
require!("hardware.gpu"); // axis presence
require!("software.daemon:postgres"); // axis value
require!("hardware.gpu.vram_gb >= 24"); // numeric ≥
require!("hardware.cpu_cores <= 64"); // numeric ≤
require!("software.runtime == \"cuda-12.4\""); // string equalityReserved-prefix tags (causal:, scope:, etc.) are rejected —
require!("scope:prod") panics with CapabilityTagError::ReservedPrefix.
Use require_axis_value! if a reserved-prefix concept needs to
land in an intent registry (it shouldn’t — those prefixes are
substrate-private).