Expand description
A pimdir store: an
io_replica ReplicaStorage backed by a SQLite index plus a
content-addressed blob directory.
The crate is split so the logic stays I/O-free and the I/O sits
behind a feature gate. sql inlines the canonical pimdir schema,
migrations and statements from the spec’s migrations/ and queries/.
codec holds the I/O-free encodings between the io_replica
model and the store columns: the flag JSON, the detail-level integer
map and the action queue’s versioned payload JSON. conventions
derives a writer’s link_id, meta and sort_key from an item’s
bytes, and hash names a body. client (feature client) holds
the three roles the format defines (spec §8), one handle each:
PimdirStore is the owner, which runs the statements against SQLite
and the blob files to service the storage seam; PimdirProducer is
the enqueue-only handle for a process that does not own the store; and
PimdirReader is the read surface both of them share, which takes
no lock and carries no write at all.
The crate is no_std with alloc; std only enters behind the
client feature, where the SQLite driver lives.
Re-exports§
pub use client::PimdirBlobFile;clientpub use client::PimdirBlobWriter;clientpub use client::PimdirBlobs;clientpub use client::PimdirCollection;clientpub use client::PimdirConflict;clientpub use client::PimdirDrainReport;clientpub use client::PimdirError;clientpub use client::PimdirGcReport;clientpub use client::PimdirItem;clientpub use client::PimdirParkedAction;clientpub use client::PimdirPendingAction;clientpub use client::PimdirProducer;clientpub use client::PimdirPurgeReport;clientpub use client::PimdirRetention;clientpub use client::PimdirSourceStore;clientpub use client::PimdirStore;clientpub use client::diagnostics::PimdirDangling;clientpub use client::diagnostics::PimdirMinted;clientpub use client::diagnostics::PimdirObjectStats;clientpub use client::diagnostics::PimdirRefcountDrift;clientpub use client::reader::PimdirReader;client
Modules§
- client
client PimdirStore: the std store that servicesio_replica’s storage seam.- codec
- Pure, I/O-free encodings between the
io_replicamodel and the pimdir columns (spec §13). No SQLite, no filesystem: the part an Android or any other implementation reuses. - conventions
- What a writer derives from an item’s bytes before handing them to the
store: its
link_id, itsmetasummary and itssort_key(spec Annex A). - hash
- The content hash naming a body in the object store (spec §5).
- sql
- The canonical pimdir SQL, inlined verbatim from the spec so the crate
is self-contained. Kept in sync with
pimdir/migrations/andpimdir/queries/, where the source of truth is.