Examples

Runnable companions in the zero-dds-snippets repository. Each page says what its example shows, how to build it, and what it prints.

ExampleWhat it shows
cross-vendor-dynamic-xtypesDecoding 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-richOne keyed struct in all three XTypes extensibilities, against four other DDS stacks, in both directions.
cross-vendor-shapesLive 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-recorderCapture, decode to JSON or SQLite, and replay any topic — with an out-of-band IDL and no compiled type.
getting-started-first-publisherThe runnable companion to the getting-started chapter: two binaries wiring a publisher and a subscriber with the low-level Rust API.
iceoryx-cyclone-zerocopyBidirectional 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-conformanceOne standalone roundtrip per language binding: a fully populated sample of combined IDL features over a real DCPS participant and pub/sub loopback.
idl-fixed-decimalIDL's exact decimal type, carried across ZeroDDS bindings in the CORBA/GIOP §9.3.2.7 packed-BCD form.
idlc-buildrsThe 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-frontendsIn 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-sinkThe 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-roundtripTwo participants in one process on the same domain, doing a real SPDP discovery handshake and a wire roundtrip over UDP loopback.
qos-policies-full-writerThe runnable companion to the QoS chapter's "Setting QoS in code": the exact UserWriterConfig from the page, registered against a real runtime.
recorder-replay-workflowA 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-configThe 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-showcaseEvery function of zerodds-dcps-async in one runnable walkthrough — factory, writer futures, reader futures, content filter, streams, Tokio integration.
rust-complex-types-roundtripA front-to-back round-trip of a real-world-shaped message under both wire representations.
rust-xcdr1-representationXCDR2 against XCDR1 for one typed sample, and the difference visible on the wire.
security-governance-gateThe 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-snippetThe 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-snippetThe verbatim @zerodds/wasm browser quickstart block from this website, kept as a tsc --noEmit fixture.
zerodds-build-sampleThe 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.

BeispielWas es zeigt
cross-vendor-dynamic-xtypesDas 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-richEin Keyed-Struct in allen drei XTypes-Extensibilities, gegen vier andere DDS-Stacks, in beide Richtungen.
cross-vendor-shapesLive-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-recorderJedes Topic aufzeichnen, nach JSON oder SQLite decodieren und wieder abspielen — mit Out-of-Band-IDL und ohne kompilierten Typ.
getting-started-first-publisherDer lauffähige Begleiter zum Getting-Started-Kapitel: zwei Binaries, die Publisher und Subscriber über die Low-Level-Rust-API verbinden.
iceoryx-cyclone-zerocopyBidirektionales 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-conformanceEin 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-decimalDer exakte Dezimaltyp der IDL, über die ZeroDDS-Bindings hinweg in der Packed-BCD-Form nach CORBA/GIOP §9.3.2.7 getragen.
idlc-buildrsDer 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-frontendsIn 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-sinkDer 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-roundtripZwei Participants in einem Prozess auf derselben Domain, mit echtem SPDP-Discovery-Handshake und einem Wire-Roundtrip über UDP-Loopback.
qos-policies-full-writerDer lauffähige Begleiter zu „QoS im Code setzen“ aus dem QoS-Kapitel: exakt die UserWriterConfig der Seite, gegen eine echte Runtime registriert.
recorder-replay-workflowEine Aufzeichnungs- und Wiedergabeschleife nur aus den CLI-Werkzeugen: publizieren, in drei Artefakte gleichzeitig aufzeichnen, aus jedem davon abspielen, das Ergebnis zurücklesen.
runtime-configDer 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-showcaseJede Funktion von zerodds-dcps-async in einem lauffähigen Durchgang — Factory, Writer-Futures, Reader-Futures, Content-Filter, Streams, Tokio-Anbindung.
rust-complex-types-roundtripEin Roundtrip von vorn bis hinten für eine praxisnah geformte Nachricht unter beiden Wire-Repräsentationen.
rust-xcdr1-representationXCDR2 gegen XCDR1 an einem typisierten Sample, und der Unterschied sichtbar auf der Leitung.
security-governance-gateDer 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-snippetDie wörtlichen @zerodds/node-Codeblöcke dieser Website, als tsc --noEmit-Fixture gehalten, damit sie gegen das echte Binding typkorrekt bleiben.
typescript-wasm-website-snippetDer wörtliche @zerodds/wasm-Browser-Quickstart-Block dieser Website, als tsc --noEmit-Fixture gehalten.
zerodds-build-sampleDer 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.