Skip to main content

Crate io_pimdir

Crate io_pimdir 

Source
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;client
pub use client::PimdirBlobWriter;client
pub use client::PimdirBlobs;client
pub use client::PimdirCollection;client
pub use client::PimdirConflict;client
pub use client::PimdirDrainReport;client
pub use client::PimdirError;client
pub use client::PimdirGcReport;client
pub use client::PimdirItem;client
pub use client::PimdirParkedAction;client
pub use client::PimdirPendingAction;client
pub use client::PimdirProducer;client
pub use client::PimdirPurgeReport;client
pub use client::PimdirRetention;client
pub use client::PimdirSourceStore;client
pub use client::PimdirStore;client
pub use client::diagnostics::PimdirDangling;client
pub use client::diagnostics::PimdirMinted;client
pub use client::diagnostics::PimdirObjectStats;client
pub use client::diagnostics::PimdirRefcountDrift;client
pub use client::reader::PimdirReader;client

Modules§

clientclient
PimdirStore: the std store that services io_replica’s storage seam.
codec
Pure, I/O-free encodings between the io_replica model 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, its meta summary and its sort_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/ and pimdir/queries/, where the source of truth is.