tiny.content
Overview · API · Code relationships · Verification · Audit
Overview
Content-addressed storage for immutable bytes names a piece of content by what it hashes to. The authority to read, a Reader, and the authority to write, a Sink, are separate values, so a caller can hold one without the other, while pairing the two for a caller trusted with both forms a Store.
The caller supplies the limits, and every store is built against a capacity derived from them, which fixes how many objects it admits, how large one object may be, and how many bytes it retains. One content identifier (a hash algorithm tag and a 32-byte digest) paired with the exact byte length of the content forms a reference. Each capability reaches the backend behind it through an opaque context pointer and a function table, its provider. Both capabilities check a reference against that capacity before the provider is called at all. A capability checks what its provider returns: a read rehashes the bytes and compares the length before it hands them back, while a publication verifies the bytes against the reference first.
Listing, deleting, and naming content by path are absent from both capabilities, so holding one grants exactly one operation. The memory namespace holds the in-memory provider, which works entirely from caller-owned buffers.
Definitions
Types and contracts
Public types and contracts.
Capacity: The sizes and the work counts a store was built with, carried by a caller from derivation into the store it builds and re-read by every capability to admit a reference.Extent: An extent gives the exact byte length of one piece of content to size the buffer a read will fill.Identifier: Carries the identity of content, and nothing else about it, so a caller compares identifiers to decide whether two byte strings are the same.Algorithm: The hash algorithm offers two choices, BLAKE3 and SHA-256, which a caller picks to name content when it derives an identifier or a reference.CapacityErrorLimits: Holds the three numbers a caller fills in to describe how large a store it wants before any storage is sized: the object count, the bytes allowed for one object, and the total content bytes.PublicationPublicationErrorReadErrorReferenceErrorStore: Holds one Reader and one Sink together for a caller trusted with both authorities.Reference: The name of one piece of content passed by a caller to every read and every publication: what it hashes to and how long it is.Reader: Read capability over one provider, for a holder that reopens bytes it already has a reference for.Sink: Write capability over one provider, for a holder that may add bytes to a store and nothing else.
Namespaces
Public namespaces.
Values and defaults
Public values and defaults.
Code relationships
Direct static dependencies extracted from parsed source by semantic graph analysis.
Uses: None
Used by: alloc_phase
Verification
No verification records are cataloged for this module in this build.
Audit
| Evidence | Value |
|---|---|
| Source | lib/content/src/root.zig |
| Definitions | 9 of 17 documented |
| Members | 0 of 0 documented |
| Public names | 17 API, 44 indexed |
| Version | 26.7.0 |
| Revision | daab053ee433 |