Flexweave
API Reference

Data Store

Typed object-keyed attached data.

Public export:

  • DataStore<T>

DataStore<T> attaches one typed value to each object id. It does not validate that ids are live by itself; use checked command paths or query helpers when the runtime needs live-id validation.

Methods

APIBehavior
newCreates an empty store.
attachInserts or overwrites data for an object id.
detachRemoves data for an object id and returns whether it existed.
hasReturns whether data is attached for an object id.
getReturns Option<&T> for attached data.
countReturns the number of attached entries.
is_emptyReturns whether the store has no attached entries.

Attaching a value for an existing id overwrites the previous value.

Object Lifetime

DataStore<T> implements ObjectLifecycleStore, so an ObjectDestructionDriver can detach data for a destroyed object. Detaching data does not emit lifecycle facts.

Validation

DataStore<T> intentionally accepts any ObjectId. Validate liveness with query::require_object, ObjectStore::exists, or checked ability/effect commands at the runtime boundary that needs the invariant.

On this page