Skip to main content

Module decode

Module decode 

Source
Available on crate feature decode only.
Expand description

The schema-aware decode seam (issues #11/#15): wire key → type name → served schema → named-field JSON, with the honest fallbacks a generic tool owes its user.

SchemaStore caches each producer’s served describe reply (RFC 08 §7) and fetches on first miss through a declared crate::bus::query::RepeatingQuery (the RFC 05 §2.1 discipline, kept warm across the negative-TTL re-asks — #37). decode_sample is the whole pipeline in one call; encoding resolution is sample > registry > sniff and the sniff never goes away.

Structs§

DecodedSample
One sample, fully decoded — the pipeline’s answer plus its honesty (#159).
DescribedSchema
One producer’s served describe set, attributed to the host that answered (#398).
SchemaStore
Per-producer schema sets, fetched lazily and cached for the process.
Sealed
A sealed store, for as long as this guard lives (SchemaStore::seal).
StoreBounds
What one store’s bounds have cost, as of one read (#340, RFC 13 §3 O6).

Enums§

Rendering
How a rendered payload was produced — a tool surfaces this honestly instead of letting decoded and sniffed output look alike.

Constants§

DEFAULT_MAX_PRODUCERS
How many producers one store remembers anything about (#340).
OBSERVE_LIMIT
How many bytes an observation path will structurally decode.

Functions§

decode_sample
prewarm
The whole decode pipeline for one sample: refine the key against the slices, resolve the schema through the store, decode — or fall back structurally, tagged with whatever we did learn and why it was not more.
resolve_encoding
Resolve the wire encoding: sample Encoding > registry encoding > sniff (RFC 08 §7).
schema_drift
Compute drift across a described fleet. Pure — feed it whatever describe replies were gathered (the store’s cache, or a fresh sweep).
schema_dump
Dump one producer’s served describe reply (issue #51), joined against its registry slice so the RFC 08 §7 totality gap is visible where the user is already looking.
schemas_for_type
Every producer’s schema for one type name (issue #51’s interface show --schema). Asking all of them is the point: same name, different hash is RFC 08 §7’s drift finding, and the type’s own page is where it is worth seeing.
structural
Structural fallback rendering — what the wire honestly says when no schema resolves.
structural_value
The structural sniff as a value rather than as text — the same ladder structural renders, stopped one step earlier.
totality_gaps
Totality per producer: every type name the slice references (subjects, procedure request/reply, blob references) must appear in the served set (RFC 08 §7). A producer that served no describe at all is NOT a gap here — that is “describe absent”, a different finding with a different fix.