Examples
Runnable companions in the zero-dds-snippets repository. Each page says what its example shows, how to build it, and what it prints.
| Example | What it shows |
|---|---|
cross-vendor-dynamic-xtypes | Decoding a foreign vendor's topic with no compile-time type: a runtime DynamicType built from out-of-band IDL, walked by the reflective XCDR codec. |
cross-vendor-rich | One keyed struct in all three XTypes extensibilities, against four other DDS stacks, in both directions. |
cross-vendor-shapes | Live RTPS interop on the OMG ShapesDemo type — each vendor's own publisher and subscriber, built with that vendor's own toolchain, run against ZeroDDS in both directions. |
decoded-recorder | Capture, decode to JSON or SQLite, and replay any topic — with an out-of-band IDL and no compiled type. |
getting-started-first-publisher | The runnable companion to the getting-started chapter: two binaries wiring a publisher and a subscriber with the low-level Rust API. |
iceoryx-cyclone-zerocopy | Bidirectional same-host zero-copy between ZeroDDS and Cyclone DDS over the iceoryx POSH shared-memory transport — no serialization and no UDP loopback on the hot path. |
idl-conformance | One standalone roundtrip per language binding: a fully populated sample of combined IDL features over a real DCPS participant and pub/sub loopback. |
idl-fixed-decimal | IDL's exact decimal type, carried across ZeroDDS bindings in the CORBA/GIOP §9.3.2.7 packed-BCD form. |
idlc-buildrs | The runnable companion to the zerodds-idlc handbook's build-script section: a build.rs that shells out to the CLI and a lib.rs that includes the generated module. |
native-frontends | In sixteen languages: the generated types plus that language's endpoint SDK exchange typed samples with a real ZeroDDS peer over UDP — no Rust runs on the frontend. |
observability-stderr-sink | The runnable companion to the observability chapter's sink layer: a DcpsRuntime started with StderrJsonSink, then a writer and a reader so the lifecycle events actually fire. |
pubsub-roundtrip | Two participants in one process on the same domain, doing a real SPDP discovery handshake and a wire roundtrip over UDP loopback. |
qos-policies-full-writer | The runnable companion to the QoS chapter's "Setting QoS in code": the exact UserWriterConfig from the page, registered against a real runtime. |
recorder-replay-workflow | A capture and replay loop built only from the CLI tools: publish, record into three artifacts at once, replay from each of them, read the result back. |
runtime-config | The runnable companion to the RuntimeConfig chapter: the full field-list struct literal, started against a real runtime, plus the page's three recipe variants as compiled functions. |
rust-async-showcase | Every function of zerodds-dcps-async in one runnable walkthrough — factory, writer futures, reader futures, content filter, streams, Tokio integration. |
rust-complex-types-roundtrip | A front-to-back round-trip of a real-world-shaped message under both wire representations. |
rust-xcdr1-representation | XCDR2 against XCDR1 for one typed sample, and the difference visible on the wire. |
security-governance-gate | The runnable companion to the security chapter's "wiring up the gate": the page's own governance XML, parsed into a SharedSecurityGate and handed to a real runtime. |
typescript-node-website-snippet | The verbatim @zerodds/node code blocks from this website, kept as a tsc --noEmit fixture so they stay type-correct against the real binding. |
typescript-wasm-website-snippet | The verbatim @zerodds/wasm browser quickstart block from this website, kept as a tsc --noEmit fixture. |
zerodds-build-sample | The companion for zerodds-build: a prost-build-style build-script helper that compiles .idl to Rust through the shared composition pipeline — no external binary, no PATH requirement. |
The remaining examples in the repository are linked from the pages they belong to — the binding overviews, the QoS Cookbook, audit logging, transport tuning and dev install.
Beispiele
Lauffähige Begleiter im Repository zero-dds-snippets. Jede Seite nennt, was ihr Beispiel zeigt, wie es gebaut wird und was es ausgibt.
| Beispiel | Was es zeigt |
|---|---|
cross-vendor-dynamic-xtypes | Das Topic eines fremden Vendors ohne Compile-Zeit-Typ decodieren: ein zur Laufzeit aus Out-of-Band-IDL gebauter DynamicType, den der reflektive XCDR-Codec abläuft. |
cross-vendor-rich | Ein Keyed-Struct in allen drei XTypes-Extensibilities, gegen vier andere DDS-Stacks, in beide Richtungen. |
cross-vendor-shapes | Live-RTPS-Interop auf dem OMG-ShapesDemo-Typ — der eigene Publisher und Subscriber jedes Vendors, mit dessen eigener Toolchain gebaut, in beide Richtungen gegen ZeroDDS gefahren. |
decoded-recorder | Jedes Topic aufzeichnen, nach JSON oder SQLite decodieren und wieder abspielen — mit Out-of-Band-IDL und ohne kompilierten Typ. |
getting-started-first-publisher | Der lauffähige Begleiter zum Getting-Started-Kapitel: zwei Binaries, die Publisher und Subscriber über die Low-Level-Rust-API verbinden. |
iceoryx-cyclone-zerocopy | Bidirektionales Same-Host-Zero-Copy zwischen ZeroDDS und Cyclone DDS über den iceoryx-POSH-Shared-Memory-Transport — keine Serialisierung und kein UDP-Loopback auf dem heißen Pfad. |
idl-conformance | Ein eigenständiger Roundtrip je Sprach-Binding: ein voll befülltes Sample kombinierter IDL-Konstrukte über einen echten DCPS-Participant und Pub/Sub-Loopback. |
idl-fixed-decimal | Der exakte Dezimaltyp der IDL, über die ZeroDDS-Bindings hinweg in der Packed-BCD-Form nach CORBA/GIOP §9.3.2.7 getragen. |
idlc-buildrs | Der lauffähige Begleiter zum Build-Script-Abschnitt des zerodds-idlc-Handbuchs: ein build.rs, das die CLI aufruft, und ein lib.rs, das das generierte Modul einbindet. |
native-frontends | In sechzehn Sprachen: die generierten Typen plus das Endpoint-SDK der jeweiligen Sprache tauschen typisierte Samples mit einem echten ZeroDDS-Peer über UDP aus — auf dem Frontend läuft kein Rust. |
observability-stderr-sink | Der lauffähige Begleiter zur Sink-Ebene des Observability-Kapitels: ein DcpsRuntime, gestartet mit StderrJsonSink, dann ein Writer und ein Reader, damit die Lifecycle-Events tatsächlich auslösen. |
pubsub-roundtrip | Zwei Participants in einem Prozess auf derselben Domain, mit echtem SPDP-Discovery-Handshake und einem Wire-Roundtrip über UDP-Loopback. |
qos-policies-full-writer | Der lauffähige Begleiter zu „QoS im Code setzen“ aus dem QoS-Kapitel: exakt die UserWriterConfig der Seite, gegen eine echte Runtime registriert. |
recorder-replay-workflow | Eine Aufzeichnungs- und Wiedergabeschleife nur aus den CLI-Werkzeugen: publizieren, in drei Artefakte gleichzeitig aufzeichnen, aus jedem davon abspielen, das Ergebnis zurücklesen. |
runtime-config | Der lauffähige Begleiter zum RuntimeConfig-Kapitel: das vollständige Struct-Literal, gegen eine echte Runtime gestartet, plus die drei Rezept-Varianten der Seite als kompilierte Funktionen. |
rust-async-showcase | Jede Funktion von zerodds-dcps-async in einem lauffähigen Durchgang — Factory, Writer-Futures, Reader-Futures, Content-Filter, Streams, Tokio-Anbindung. |
rust-complex-types-roundtrip | Ein Roundtrip von vorn bis hinten für eine praxisnah geformte Nachricht unter beiden Wire-Repräsentationen. |
rust-xcdr1-representation | XCDR2 gegen XCDR1 an einem typisierten Sample, und der Unterschied sichtbar auf der Leitung. |
security-governance-gate | Der lauffähige Begleiter zu „das Gate verdrahten“ aus dem Security-Kapitel: das Governance-XML der Seite selbst, in ein SharedSecurityGate geparst und einer echten Runtime übergeben. |
typescript-node-website-snippet | Die wörtlichen @zerodds/node-Codeblöcke dieser Website, als tsc --noEmit-Fixture gehalten, damit sie gegen das echte Binding typkorrekt bleiben. |
typescript-wasm-website-snippet | Der wörtliche @zerodds/wasm-Browser-Quickstart-Block dieser Website, als tsc --noEmit-Fixture gehalten. |
zerodds-build-sample | Der Begleiter für zerodds-build: ein Build-Script-Helfer im Stil von prost-build, der .idl über die geteilte Kompositions-Pipeline nach Rust übersetzt — kein externes Binary, keine PATH-Anforderung. |
Die übrigen Beispiele des Repositorys sind von den Seiten verlinkt, zu denen sie gehören — den Binding-Übersichten, dem QoS-Cookbook, Audit-Logging, Transport-Tuning und Dev-Install.