Skip to main content

Module exactly_one

Module exactly_one 

Source
Expand description

exactly_one_value — explicit unwrap of a unary structural body (SRD-66 §“Surface 4”).

The motivating use case has a CQL describe keyspace op whose body is a single row × single text column. To regex-match the schema text, the workload asserts unary shape and unwraps. No implicit modal projection — identical workload source against a non-unary body must surface a clear shape diagnostic, not silently diverge from intent.

Scalars pass through; typed vectors must have exactly one element; a Json body is walked as rows × columns × leaf and rejected with the diagnostic below when not unary (SRD-66 §“Surface 4 §Semantics”):

exactly_one_value: expected unary structure (1 row × 1 column),
                   found <r> rows × <c> columns

Structs§

ExactlyOneValue
Assert that the input value is a unary structure and return its single cell as a String. See module docs.