Skip to main content

Module param_helpers

Module param_helpers 

Source
Expand description

Parameter resolution and validation helpers (SRD 12 §“Parameter resolution and validation”).

These nodes are pass-throughs with assertions on the value they carry. They let workloads say “this parameter must be defined”, “this number must be in range”, “this string must match a pattern” — with the assertion fired at the earliest point the value is known. For compile-time-constant inputs, constant folding collapses the assertion into a hard compile error. For init-time-resolved workload params, the assertion fires on the first evaluation (effectively init). For live-read inputs, the assertion fires per cycle.

Failure is reported via panic with a descriptive message. Panics inside eval surface as workload startup errors for init-time values and as cycle-time aborts for live-read inputs; both are the intended consequence of a violated precondition.

Structs§

InRange
Assert that a u64 value is in the inclusive range [lo, hi].
IsOneOf
Assert that a u64 value is one of an enumerated allow-list. SRD-80b Phase C migration via Const<Vec<C>> combinator. JIT-lowered as unrolled inline comparisons (JitOp::IsOneOfCheck); the fail path calls an extern that carries the allow-list contents for message parity with this body’s panic.
IsPositive
Assert that a u64 value is strictly positive (> 0).
Matches
Assert that a string value matches a regex pattern. SRD-80 PR B.6 migration.
Required
Assert that an input is defined (i.e. not Value::None).
ThisOr
Return primary if it is defined, otherwise default.

Functions§

signatures
The hand-registered signatures of this module.