Expand description
The blob-interpreter seam (roadmap §4.5 follow-up): a dependency-inversion
contract so consumers can decode opaque BLOB values in schema context —
WebKit Local Storage UTF-16, or the general blob-decoder crate (plist /
gzip / JSON / …) — WITHOUT this reader library taking on any decode dependency
or MSRV cost.
The library owns the contract + the schema context (BlobContext); a
consumer supplies the decoder by implementing BlobInterpreter. Passing
None is the default: unchanged behaviour, the raw bytes are surfaced as-is.
Secure by design: Interpretation::lossy is a struct field, so a caller
cannot render a lossy decode as a faithful one — the uncertainty is structural,
not a side-channel warning.
Structs§
- Blob
Context - The schema context a
BlobInterpretermay use as a decoding prior — e.g. a known table/column (“this column holds UTF-16 Local Storage values”) lifts a structural, low-confidence reading to a high-confidence one. - Interpretation
- A consumer-supplied decoding of an opaque
BLOBvalue. The observation of what the bytes are, never a guarantee —lossyrecords when the decode dropped or substituted data. - Local
Storage Interpreter - The built-in, dependency-free
BlobInterpreterforWebKit/Chromium Local Storage. A.localstorageItemTable.valueBLOB holds its string as raw UTF-16-LE (no BOM, no type byte); this decodes it — but ONLY when the schema context identifies theItemTablecolumn, which is the prior that makes the UTF-16-LE reading confident. An arbitrary BLOB is not this interpreter’s job (that is the generalblob-decoderadapter); it returnsNone.
Traits§
- Blob
Interpreter - A consumer-supplied interpreter of opaque
BLOBvalues. Implemented OUTSIDE this crate (ablob-decoderadapter, or the built-in Local Storage decoder) so the reader library carries no decode dependency.
Functions§
- interpret_
values - Apply
interpreterto everyBLOBinvalues, returning(column_index, interpretation)for each blob the interpreter recognised. Non-blob values are skipped.interpreter == Noneyields an empty result — the default, unchanged behaviour, so this passthrough is non-breaking for every existing caller.