Skip to main content

Module listing

Module listing 

Source
Expand description

The read path: a snapshot plus a session, filtered.

§Why filtering happens on read rather than on publish

A store holding only the primitives a session may see cannot answer for two sessions at once, and a store publishing a per-session copy would turn one registration into one snapshot per live session. So the store holds the union and the filter is the session’s, applied where the question is asked: RegistryStore::list_visible.

The filter is is_visible, which is a pure function of three inputs and reads no shared state. That is what lets a listing be a cheap scan — a u128 mask test and a scope subset per primitive, no allocation, no lock, and no promise about what another session would see.

§The count must come from the same pass

list_visible returns the visible primitives and the total. Computing the total separately would be a second filter, and a second filter can disagree with the first if a primitive’s metadata were ever anything but a pure function of its payload — which is why PrimitiveMeta is derived and never stored. One pass, one answer, no way for the two numbers to come from different worlds.

Structs§

Listing
What one session can see, and how much exists.