Skip to main content

Module room

Module room 

Expand description

A room’s index of the records it holds. Ownership of the index document is the caller’s business — the compositor keeps one per room (shell::room_records).

The reference is what grants access. A member can reach only the records the room references. Removing a reference stops future changes flowing; it cannot un-share bytes a peer already synced.

Functions§

discoverable_references
A deterministic, resource-bounded view of collaborator-supplied room names. It reads at most a small fixed prefix of the CRDT map and returns at most super::MAX_DISCOVERED_ROOM_RECORDS valid entries. It does not open records, create persistence, or join record routes; the caller must make that explicit after choosing a record.
duplicate
Copy, the explicit verb: mints a new record id rather than reusing the origin’s. The new document is created empty by the caller’s next RecordSet::checkout; this returns the identity to check out.
holds
Whether this room references id.
reference
Bring a record name into this room. Keyed by record id (not appended to a list) so two machines referencing the same name concurrently converge on one index entry. The document it resolves to remains room-scoped; this is not a cross-room data grant.
references
Every well-formed record this room references. This is retained for callers that already have their own work bound; hosts that learn a room supplied index should use discoverable_references instead.
referencing
Records this room holds that reference target under relation — how an app finds “the annotations for this document” without a second index.
unreference
Drop a record’s reference from this room. The record itself is untouched — another room may hold an independently scoped replica.