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.

Push 1 implements the assertion against the existing Value variants (Str, Bool, U64, F64, VecF32, VecI32, None). Push 2 will settle the structural body type (Json or similar) and extend this node to walk row × column structure with the diagnostic format from 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.