Flexweave
API Reference

Registry

Borrowed key lookup for caller-owned definitions.

Public exports:

  • RegistryEntry
  • DefinitionRegistryEntry
  • Registry

RegistryEntry exposes a stable string key.

DefinitionRegistryEntry builds the runtime definition associated with an entry.

Traits

TraitRequired APIPurpose
RegistryEntrykey(&self) -> &strStable key lookup.
DefinitionRegistryEntrybuild_definitionMaterializes a runtime definition.

Registry<'a, Entry>

Registry borrows an ordered slice of entries and supports predicate lookup, key lookup, and definition building.

APIBehavior
newBorrows a caller-ordered slice.
entriesReturns the borrowed entries in caller-owned order.
lookupFinds the first entry accepted by a predicate.
lookup_keyFinds the first RegistryEntry with a matching key.
definitionBuilds a definition from a matching DefinitionRegistryEntry.

Use it when your content layer has richer authored records than the primitive definition structs.

Registry does not validate duplicate keys. If uniqueness is required, enforce that in the content layer or use the dedicated definition collections such as AbilityDefinitions and EffectDefinitions.

On this page