Skip to main content

Module shared_entity

Module shared_entity 

Source
Expand description

Cached entities that share their fields between the views holding them.

Every view of an export receives the same patches, and a derived view holds the entity its source view holds, so most cached copies of one entity have the same fields. Each view’s frames carry their own _version (see the projector), which a view’s copy keeps, so the copies differ in that one field. A SharedEntity keeps every other field behind an Arc that the copies share, and _version beside it, per copy. A change replaces or copies the shared fields before it writes (copy-on-write), so it never reaches another holder’s copy.

Structs§

SharedEntity
One copy of a cached entity: fields shared with every other copy that has the same ones, plus this copy’s _version.

Constants§

VERSION_FIELD
The field each view’s copy of an entity stamps with its own frame version.

Traits§

EntityFields
Field access shared by plain values and SharedEntity copies.

Functions§

lookup
The value at path, field names from the top of entity; the whole entity for an empty path. None as soon as a step is missing.