macro_rules! dispatch_ring {
($ring:expr, $body:expr) => { ... };
($ring:expr, $body:expr, else $fallback:expr) => { ... };
}Expand description
Dispatch a runtime ring: u8 value to a generic body that wants
a concrete ZZn type. The body is evaluated in a context where:
ZZis atypealias for the matchingZZnring,PHIis aconst usizeequal to that ring’sphi(n)(storage width of the integer-basis representation).
Two forms:
ⓘ
// Panic on unknown ring (typical for CLI / internal call sites):
dispatch_ring!(ring, body)
// Fallback expression on unknown ring (typical for WASM /
// user-facing entry points that prefer a structured error):
dispatch_ring!(ring, body, else fallback)The bare form expands to the else form with a panic fallback,
so both share the same per-ring match table; adding a ring touches
exactly one place.