Skip to main content

Module cursor_sugar

Module cursor_sugar 

Source
Expand description

Cursor-constructor sugar registry.

A cursor sugar lets a node module (vectordata, future tabular sources, etc.) recognize a non-standard cursor x = foo(...) form and rewrite it into:

  1. A synthetic constructor expression (typically range(...)) that the standard extent-resolution path can drive, and
  2. Zero or more auxiliary bindings to emit after the cursor’s input ports are wired — typical examples are an init-time prebuffer call and per-field projection bindings (<cursor>__vector := vector_at("ds:profile", <cursor>__ordinal)).

The core compiler stays agnostic: it walks the inventory of registered handlers, picks the first match, and applies the rewrite. Adding a new sugar form is a single inventory::submit! plus a handler function — no compile.rs change required.

Structs§

AuxBinding
One binding emitted by sugar after cursor input wiring.
CursorSugar
The rewrite returned by a sugar handler.
CursorSugarRegistration
One inventory entry. Handlers self-name so listings can show them and so the dispatcher can attribute errors to the right module.

Functions§

dispatch
Walk the inventory and dispatch to the first handler that matches constructor. Returns the rewrite to apply, None if no handler matches, or the handler’s error.

Type Aliases§

CursorSugarFn
A handler that recognizes one or more cursor-constructor shapes and produces a CursorSugar rewrite. Return: