Skip to main content

Module spec

Module spec 

Source
Expand description

IndexKind + IndexSpec — runtime declaration of a secondary index.

IndexSpec is the runtime declaration a Document type emits from Document::indexes() (#57); the on-disk reflection is the IndexDescriptor in crate::catalog. The spec is small and pure-data so it composes cleanly with the derive macro that lands in M9.

§Power-of-ten posture

  • Rule 5. IndexSpec::validate is the runtime boundary that pairs with the kind-specific type invariants (Composite requires ≥ 2 paths, Each requires exactly 1 path, etc.). The constructor helpers (IndexSpec::unique, ::each, …) call validate so a caller cannot construct an invalid spec.
  • Rule 7. No unwrap / expect — every fallible path returns crate::Result.
  • Rule 9. IndexKind is a concrete enum, NOT dyn IndexKind — static dispatch through match.

Structs§

IndexSpec
A runtime index declaration.

Enums§

IndexKind
What kind of secondary index a given IndexSpec declares.