Skip to main content

Module record_content

Module record_content 

Expand description

Content an app’s record references, travelling on the record’s route.

A record holds a reference to its binaries (a picture’s content hash), never the bytes. An app reads and writes those bytes through the content store its host lent it; RecordContent wraps that store so that

  • content the app stores is also offered to its host, which keeps it where the record’s other readers are served from (CollabRequest::OfferContent);
  • content the record references and this device lacks is asked of the host, which answers from this device or the record’s route (CollabRequest::WantContent), and reads as [ContentState::Pending] until it is here;
  • content that arrives (CollabEvent::RecordContent) is verified and kept in the store, where the app’s next read finds it.

The app’s window and the store meet in a ContentLane, one per record of a process: the store queues its requests there, and the window’s collaboration loop sends them on the record’s route and hands back what arrives.

A record other than the window’s own — one of the person’s records, kept in their own room — has a lane of its own that names its route (ContentLane::record_store): its content lives where that record does, on the person’s devices, never in the window’s room.

Structs§

ContentLane
Where one record’s content store and its window’s collaboration meet.
LaneRequests
What the window sends on the record’s route.
RecordContent
A record’s content store: the store a host lent the app, with content the record references travelling on the record’s route.

Constants§

MAX_RECORD_CONTENT_BYTES
Largest content one record references.