zerodds-recorder
Deterministic record/replay format for the
ZeroDDS stack: pure-Rust .zddsrec wire format
with reader, writer and a thread-safe live-session API. Safety
classification: STANDARD.
Spec mapping
| Spec | Section |
|---|---|
| ZDDSREC 1.0 | §1-§5 (magic + version + header layout + frame layout + sample kind + index discipline) |
Spec doc: docs/specs/zddsrec-1.0.md.
What's inside
- Format wire structures:
Header,Frame,FrameView,SampleKind,ParticipantEntry,TopicEntry,ZDDSREC_MAGIC,ZDDSREC_VERSION. RecordWriter— writes a.zddsrecstream incrementally into astd::io::Writesink.WriteErrorcovers IO + format violations.RecordReader— parses a&[u8]buffer intoHeader+ frame sequence.ReadErrorwith concrete truncation paths.RecordingSession— high-level live API withrecord_sample(topic, type, payload), atomic counters, lazy header and topic indexing.
Layer position
Layer 4 — core services. Pure Rust + alloc, no ZeroDDS crate deps. Consumed by tools/replay (inspect/dump/replay CLI) and tools/recorder-bridge (live recording from the DcpsRuntime).
Quickstart
Writing:
use ;
let mut sink = Vecnew;
let mut writer = new;
writer.write_header.unwrap;
writer.write_frame.unwrap;
Reading:
use RecordReader;
let bytes: & = b""; // .zddsrec stream
let reader = new.unwrap;
for frame in reader.frames
Feature flags
| Feature | Default | Purpose |
|---|---|---|
std |
✅ | Standard library + std::io::Write. |
alloc |
✅ via std | Vec/String. |
safety |
❌ | Reserve hook for extra defensive checks. |
Stability
1.0.0-rc.1. Wire format ZDDSREC_VERSION = 1 is RC1-stable; an
incompatible change would bump the version constant (the Reader
rejects unknown versions). Additive extensions (streaming
reader, IndexAddFrame, optional compression) are designed as
major-2.0 hooks — see spec §"Stability and roadmap".
Tests
17 unit tests: format roundtrips, reader truncation paths, writer header-once discipline, session thread safety.
License
Apache-2.0. See LICENSE.
See also
docs/specs/zddsrec-1.0.md— wire-format spec.tools/replay—zerodds-replay inspect|dump|replayCLI.tools/recorder-bridge— live recording from the DcpsRuntime.