Skip to main content

Module content

Module content 

Source
Expand description

Content sharing (§12 of plans/PLAN_WIRE_PROTOCOL.md): put/get by content-address, over a dedicated QUIC stream — ordinary CALL/RESULT (§6.4) against four well-known _content.* procedures, ported from macula_content_transfer.erl. Not a separate wire protocol: nothing here is new frame types, just calls a normal crate::connection::Session could already make, sent on a stream opened via Session::open_dedicated_stream instead of the control stream.

Deliberate v1 simplification (documented per spec §12.2): chunked transfers here run strictly sequentially, one _content.put_block / _content.get_block in flight at a time on the single dedicated stream this module opens — not the reference’s parallel multi-lane algorithm (round-robin chunks across up to 4 concurrent streams). Multi-lane parallelism is a throughput optimization, not a correctness requirement: every _content.* call, the MCID scheme, and the manifest wire format are identical either way, so this v1 client interoperates fully with a station built to serve a parallel-lane peer, and lanes can be added later purely as a performance improvement with no wire change.

Sequential retrieval has one incidental upside over the reference: chunks arrive and get appended in index order for free, so there’s no need for the reference’s “accumulate into a map keyed by index, then reassemble” step.

Enums§

GetError
PutError

Constants§

CONTENT_REALM
Reserved realm sentinel for all _content.* calls — 32 zero bytes, distinct from any real realm (plans/PLAN_WIRE_PROTOCOL.md §12.1).

Functions§

get
Fetch and verify the content addressed by mcid.
put
Store data, returning the MCID it’s now addressable by.