zerodds-recorder-decode
Tooling. Support crate (safety class COMFORT, no runtime hot path) that decodes DDS samples for
zerodds-spy,zerodds-recordandzerodds-replay; it implements no specification of its own.
- Source: crates/recorder-decode
- API docs: docs.rs/zerodds-recorder-decode
zerodds-recorder-decode turns received samples into typed JSON and SQLite and reads
them back for replay. It builds on zerodds-wire-codec, which walks the type model in both
directions, and on the DynamicType of zerodds-types. Both sinks keep the raw
CDR bytes of every sample, so zerodds-replay can publish them again byte for byte from
either format.
type_source—TypeSource::from_idlparses an out-of-band IDL file (the--type-filepath) throughzerodds-idl-composewith all vendor extensions admitted;resolvereturns theDynamicTypefor a type name. A reference that resolves nowhere refuses the file.parse_topic_type_mapreadstopic=Typeentries.wire—encoding_of(type, xcdr2)derives the framing (PLAIN_CDR1,PLAIN_CDR2,DELIMITED_CDR,PL_CDR1,PL_CDR2) from the extensibility of the type and the XCDR version, per XTypes 1.3 §7.4 Table 17.json_sink—DynamicData→ JSON and an NDJSON sink. Each line carriestopic,type,recv_ts_ns,writer, the decodedvalueandraw_cdras hex. Integers outsidei64/u64,fixed<P, S>andlong doubleare written as strings; NaN and ±inf becomenull.sqlite_sink— one tablet_<T>per topic withsample_id(record marker, primary key),recv_ts_ns,writer,raw_cdrand one typed column per scalar member (1:1 nested structs and bitsets flattened tofield__sub); child tablest_<T>__<member>for sequences, arrays, maps and bitmasks, joined bysample_id;_typesholds the IDL per topic. Auint64above 263,fixed<P, S>andlong doubleare stored as exactTEXT. Members without a flat column shape are skipped and listed byskipped_members.helper_queriesemits ready-to-run SQL.replay_source—from_ndjsonandfrom_sqlite(opened read-only, sorted byrecv_ts_nsacross topics) returnRecordedSamples (topic,type_name,recv_ts_ns,raw_cdr). Reading.zddsrecstays inzerodds-recorder.
Consumers
zerodds-spy,zerodds-record,zerodds-replay(all intools/).
Status
std; noforbid(unsafe_code)attribute, and nounsafeinsrc/.- Library only, no binaries. No cargo features. Dependencies include
serde_jsonandrusqlite(workspace version 0.32 withbundled). - 28 test functions in
src/, 6 intests/decode_roundtrip.rs, which runs the pipeline IDL → encode → JSON and SQLite sinks → replay source across XCDR1/XCDR2 and both byte orders.
zerodds-recorder-decode
Werkzeuge. Unterstützendes Crate (Sicherheitsklasse COMFORT, kein zeitkritischer Pfad zur Laufzeit), das DDS-Samples für
zerodds-spy,zerodds-recordundzerodds-replaydekodiert; es implementiert keine eigene Spezifikation.
- Quelle: crates/recorder-decode
- API-Docs: docs.rs/zerodds-recorder-decode
zerodds-recorder-decode wandelt empfangene Samples in typisiertes JSON und SQLite um und
liest sie für die Wiedergabe zurück. Es baut auf zerodds-wire-codec auf, das das
Typmodell in beide Richtungen durchläuft, und auf dem DynamicType aus
zerodds-types. Beide Senken behalten die rohen CDR-Bytes jedes Samples, sodass
zerodds-replay sie aus beiden Formaten Byte für Byte erneut veröffentlichen kann.
type_source—TypeSource::from_idlparst eine separat übergebene IDL-Datei (der Weg über--type-file) mitzerodds-idl-compose, wobei alle Herstellererweiterungen zugelassen sind;resolveliefert denDynamicTypezu einem Typnamen. Eine Referenz, die sich nicht auflösen lässt, führt zur Ablehnung der Datei.parse_topic_type_mapliest Einträge der Formtopic=Type.wire—encoding_of(type, xcdr2)leitet die Rahmung (PLAIN_CDR1,PLAIN_CDR2,DELIMITED_CDR,PL_CDR1,PL_CDR2) aus der Erweiterbarkeit des Typs und der XCDR-Version ab, nach XTypes 1.3 §7.4 Tabelle 17.json_sink—DynamicData→ JSON und eine Senke für NDJSON. Jede Zeile enthälttopic,type,recv_ts_ns,writer, den dekodiertenvalueundraw_cdrals Hex. Ganzzahlen außerhalb voni64/u64,fixed<P, S>undlong doublewerden als Zeichenketten geschrieben; NaN und ±inf werden zunull.sqlite_sink— eine Tabellet_<T>je Topic mitsample_id(Datensatzmarke, Primärschlüssel),recv_ts_ns,writer,raw_cdrund einer typisierten Spalte je skalarem Member (1:1 geschachtelte Strukturen und Bitsets flach alsfield__sub); Kindtabellent_<T>__<member>für Sequenzen, Arrays, Maps und Bitmasks, verknüpft übersample_id;_typesenthält die IDL je Topic. Einuint64über 263,fixed<P, S>undlong doublewerden exakt alsTEXTgespeichert. Member ohne flache Spaltenform werden übersprungen und vonskipped_membersaufgelistet.helper_queriesgibt ausführbares SQL aus.replay_source—from_ndjsonundfrom_sqlite(nur lesend geöffnet, über alle Topics nachrecv_ts_nssortiert) liefernRecordedSample-Werte (topic,type_name,recv_ts_ns,raw_cdr). Das Lesen von.zddsrecbleibt inzerodds-recorder.
Konsumenten
zerodds-spy,zerodds-record,zerodds-replay(alle untertools/).
Status
std; kein Attributforbid(unsafe_code), und keinunsafeinsrc/.- Nur Bibliothek, keine Binaries. Keine Cargo-Features. Zu den Abhängigkeiten gehören
serde_jsonundrusqlite(Workspace-Version 0.32 mitbundled). - 28 Testfunktionen in
src/, 6 intests/decode_roundtrip.rs, das die Kette IDL → Kodierung → Senken für JSON und SQLite → Wiedergabequelle über XCDR1/XCDR2 und beide Byte-Reihenfolgen durchläuft.