Rindle docs and package mapSkip to main content

Module canon

Module canon 

Expand description

The canonical value-equivalence key (CanonVal / CanonKey) — the join family’s grouping key, the limiters’ partition identity, and a parameterized query family’s binding (design 310, D1). Lives in rindle-value (below the engine, so rindle-wire can name it) and is re-exported here as the rindle::canon namespace. The canonical value-equivalence keyCanonVal / CanonKey — one Hash + Eq encoding of the engine’s exact equality class, shared by every consumer that must agree on “these two cells are the same value”:

  • the join family’s grouping and the join membership pre-check (rindle’s op/join_util.rs, where this type was born as canonicalValue, flipped-join.ts:600);
  • the partitioned limiters’ state keys (op/partition.rs folds an integral Float to its Int the same way CanonVal::of does);
  • a parameterized query family’s binding (design 310, D1): the literal a subscriber bound (rindle-wire’s FamilyKey extraction), the engine’s partition membership test (a row cell), and the daemon’s per-partition demux (a root row cell) must agree exactly, and one type is the only way to make that structural rather than tested.

It lives in this dependency-free crate — below the engine — because rindle-wire cannot see a pub(crate) item in rindle, and because the encoding is a property of the value vocabulary, not of any operator.

Numerics canonicalize by their exact equality class (design 226 §5.4, float_int_class): a finite, integral, in-i64-range, non--0.0 Float shares Int’s key — so Int(1) and Float(1.0) group together, exactly when values_equal says they are equal. Every other float keeps f64::to_bits identity, matching total_cmp’s classes (the -0.0/0.0 and NaN-payload distinctions the engine makes). Null gets its own token: two null cells share a key, which is what a partition wants (null == null under the sort comparator) and harmless for a join (a null-keyed parent misses every non-null child group and is never spuriously joined — values_equal says null != null).

Enums§

CanonVal
One column of a CanonKey — a type-tagged, Hash + Eq value. The tag is the variant itself, so Int(1) and Str("1") are distinct keys (the JS prefixes a type char; the Rust enum carries the type for free).

Functions§

canonical_key
The CanonKey of row over the key columns, in key order.
canonical_key_of_constraint
Canonical key over a (ColId, OwnedValue) constraint’s values, in constraint order. For a join constraint built in to_key order this agrees with canonical_key(parent_row, to_key) for any parent the constraint matches — the two sides a flipped join compares to group each child under its parent’s IN-batch entry.

Type Aliases§

CanonKey
A canonical key over a compound column tuple (canonicalKey, flipped-join.ts:585): a join’s correlation key, a limiter’s partition tuple, or a family’s binding. Hash + Eq, so it keys a grouping map directly — no per-row String alloc (the JS concatenates a tagged string; the typed tuple is the faster, exact Rust form).