Skip to main content

Module entity_refs

Module entity_refs 

Source
Expand description

The one list of entity-reference fields (spec/world.md “Identity”, schema/entity-refs.json) — the crate’s embedded copy. The canonical list is generated from world.schema.json’s x-entity-ref markers by schema/generate-entity-refs.mjs, but a published crate can’t read the repo’s schema/ at runtime, so the passes read this table instead, and tests/entity_refs.rs fails when it drifts from the canonical file.

EntityRefKind::Bindable — a name is accepted at intake and MUST bind to an id at ingestion; EntityRefKind::Id — numeric only. The scope is the object the path walks from: an entity (or its patch, the same fields), the manifest’s avatar, or one creation in creations[]. "*" walks every array element.

Two walks read the table: [walk_ref_path] over the raw op JSON (the authoring pass binds names before the typed read) and [RefWalk] over the typed model (name binding after apply, merge rewriting) — the same list either way, so the three passes can never drift apart over hand-written field mentions.

Structs§

EntityRefField
One marked entity-reference field: a scope, the path that walks it ("*" walks every array element), and what it accepts.

Enums§

EntityRefKind
What a marked field accepts.
EntityRefScope
The object a marked path walks from.

Constants§

ENTITY_REFS
The one list of entity-reference fields, in the canonical file’s order — the embedded copy of schema/entity-refs.json’s refs.

Functions§

refs_of
The marked refs of one scope.
refs_of_kind
The marked refs of one scope and kind.