Expand description
Content-addressed object store.
Objects are addressed by the lowercase hex SHA-256 of their UNCOMPRESSED
content and persisted DEFLATE-compressed (pure-Rust flate2/miniz_oxide
backend — the workspace stays free of C dependencies). Compression is an
internal detail behind put_object/get_object; because the address is
the hash of the plaintext, the codec can be swapped (e.g. to zstd) without
changing object identity or breaking dedup.
Functions§
- get_
object - Load and decompress the object addressed by
hashfordoc_id. - has_
object - True if an object with
hashalready exists fordoc_id. - object_
hash - Compute the lowercase-hex SHA-256 address of
content. Pure; no IO. - object_
size - The on-disk (compressed) byte size of the object addressed by
hash. Errors if the object does not exist. - put_
object - Store
content, returning its hash address. Idempotent / dedup’d: if the object already exists it is NOT rewritten. - put_
object_ with_ hash - Store
contentat the already-computed addresshash. Idempotent / dedup’d: if the object already exists it is NOT rewritten. Callers that have already hashedcontent(e.g. for a dedup check) use this to avoid hashing twice;hashMUST equalobject_hash(content).