zerodds-corba-rust

Layer 8 — CORBA stack. IDL → Rust code generator for CORBA service constructs; ZeroDDS vendor spec zerodds-corba-rust-1.1, conformance basis OMG CORBA 3.3 Annex A and OMG IDL4.

zerodds-corba-rust is a build-time generator. generate_corba_rust_module(ast, opts) walks the module tree of the common AST that zerodds-idl-lower produces and returns Rust source. It uses the Annex A.1 tables and the repository-id rule of zerodds-corba-codegen. The data types (struct, union, enum) and their encode/decode come from zerodds-lang-rules; the output of this crate is written to be concatenated with that output. Arguments are marshalled with the zerodds-wire Writer.

  • interface I → pub trait I, the client stub IStub (holds an ObjectReference and an Arc<dyn CorbaConnection>) and the server skeleton dispatch_<i>. Each generated skeleton first answers the six CORBA::Object operations through runtime::dispatch_object_operation.
  • attribute T x → getter fn x(&self), plus set_x unless readonly.
  • Parameters: in by value, out/inout as &mut; oneway → method without reply; raises (…) → a per-interface {I}Error enum.
  • valuetype V → pub trait V: ValueBase plus marshalling; factory → free function <v>_init_<name>; inheritance → trait bound, state flattened base first.
  • component/home → lifecycle trait and repository id. The container lifecycle beyond configuration_complete and ccm_remove, and the receptacle, facet and event bindings, belong to zerodds-ccm.
  • @ami on an interface or operation → <Iface>AmiHandler and sendc_<op> (callback model), sendp_<op> with a <Iface><Op>Poller (polling model), both over AsyncCorbaChannel.
  • module M → pub mod M.

The crate also exports the runtime types the generated code refers to: CorbaConnection (invoke, invoke_oneway; implemented by the transport), AsyncCorbaChannel, CorbaException, SkeletonResult, Servant, the POA policy enums and PoaBuilder, ComponentServant/ComponentHome, and ValueStreamWriter/ValueStreamReader for the valuetype encoding (value tags, indirection for shared values, chunked and nested chunked encoding, codebase URL resolution through a CodebaseResolver). ObjectReference, ValueBase and TypeCode are re-exported from zerodds-corba-rt.

Spec anchors

  • ZeroDDS vendor spec zerodds-corba-rust-1.1; conformance basis OMG CORBA 3.3 Annex A (A.1 tables, via zerodds-corba-codegen) and OMG IDL4.
  • OMG CORBA 3.3 Part 2 §15.3.4 (valuetype encoding; §15.3.4.1 value_tag, §15.3.4.2 repository-id list, §15.3.4.3 chunked encoding), §15.4.2 (CORBA::Object operations in GIOP requests).
  • CORBA Messaging §22 (AMI; §22.5 callback model, §22.6 polling model); OMG IDL 4.2 §8.3.5 (@ami).
  • OMG CCM 4.0 §6 (component, home).
  • Coverage: zerodds-corba-rust-1.1.

Consumers

  • zerodds-corba-ccm — optional dependency, enabled by its default feature std (CorbaConnection, ObjectReference, SkeletonResult for DII and DSI).
  • zerodds-corba-interop (not published) — build-dependency (its build.rs generates Rust from the feature-matrix IDL) and dependency (its runtime implements CorbaConnection and AsyncCorbaChannel).

Status

  • std only; the crate documents itself as a build-time tool.
  • forbid(unsafe_code).
  • Library only, no binaries. No cargo features.
  • 20 test functions in src/, 29 in tests/: 15 snapshot tests (insta), 5 tests of the value stream encoding, 9 compile checks marked #[ignore] that run cargo check over generated code.

zerodds-corba-rust

Layer 8 — CORBA-Stack. Codegenerator IDL → Rust für CORBA-Dienstkonstrukte; ZeroDDS-Herstellerspezifikation zerodds-corba-rust-1.1, Konformanzbasis OMG CORBA 3.3 Annex A und OMG IDL4.

zerodds-corba-rust ist ein Generator, der beim Bauen läuft. generate_corba_rust_module(ast, opts) durchläuft den Modulbaum des gemeinsamen AST, den zerodds-idl-lower erzeugt, und gibt Rust-Quelltext zurück. Er nutzt die Tabellen aus Annex A.1 und die Regel für Repository-IDs aus zerodds-corba-codegen. Die Datentypen (struct, union, enum) mit encode/decode liefert zerodds-lang-rules; die Ausgabe dieses Crates ist dafür geschrieben, mit jener Ausgabe zusammengefügt zu werden. Argumente werden mit dem Writer aus zerodds-wire serialisiert.

  • interface I → pub trait I, der Stub für den Client IStub (hält eine ObjectReference und ein Arc<dyn CorbaConnection>) und das Skeleton für den Server dispatch_<i>. Jedes erzeugte Skeleton beantwortet zuerst die sechs CORBA::Object-Operationen über runtime::dispatch_object_operation.
  • attribute T x → Getter fn x(&self), dazu set_x, sofern nicht readonly.
  • Parameter: in als Wert, out/inout als &mut; oneway → Methode ohne Antwort; raises (…) → ein Enum {I}Error je Interface.
  • valuetype V → pub trait V: ValueBase samt Serialisierung; factory → freie Funktion <v>_init_<name>; Vererbung → Trait-Bound, Zustand mit der Basis zuerst flach angeordnet.
  • component/home → Trait für den Lebenszyklus und Repository-ID. Der Lebenszyklus des Containers über configuration_complete und ccm_remove hinaus sowie die Bindungen für Receptacles, Facets und Events gehören zu zerodds-ccm.
  • @ami an einem Interface oder einer Operation → <Iface>AmiHandler und sendc_<op> (Rückrufmodell), sendp_<op> mit einem <Iface><Op>Poller (Abfragemodell), beide über AsyncCorbaChannel.
  • module M → pub mod M.

Das Crate exportiert außerdem die Laufzeittypen, auf die der erzeugte Code verweist: CorbaConnection (invoke, invoke_oneway; vom Transport implementiert), AsyncCorbaChannel, CorbaException, SkeletonResult, Servant, die Enums der POA-Policies und PoaBuilder, ComponentServant/ComponentHome sowie ValueStreamWriter/ValueStreamReader für die Kodierung von Valuetypes (Value-Tags, Indirektion für geteilte Werte, gestückelte Kodierung (chunked), auch geschachtelt, Auflösung von Codebase-URLs über einen CodebaseResolver). ObjectReference, ValueBase und TypeCode werden aus zerodds-corba-rt reexportiert.

Spec-Anker

  • ZeroDDS-Herstellerspezifikation zerodds-corba-rust-1.1; Konformanzbasis OMG CORBA 3.3 Annex A (Tabellen aus A.1, über zerodds-corba-codegen) und OMG IDL4.
  • OMG CORBA 3.3 Part 2 §15.3.4 (Kodierung von Valuetypes; §15.3.4.1 value_tag, §15.3.4.2 Liste von Repository-IDs, §15.3.4.3 gestückelte Kodierung), §15.4.2 (CORBA::Object-Operationen in GIOP-Requests).
  • CORBA Messaging §22 (AMI; §22.5 Rückrufmodell, §22.6 Abfragemodell); OMG IDL 4.2 §8.3.5 (@ami).
  • OMG CCM 4.0 §6 (component, home).
  • Abdeckung: zerodds-corba-rust-1.1.

Konsumenten

  • zerodds-corba-ccm — optionale Abhängigkeit, aktiviert durch dessen Feature std (Standard) (CorbaConnection, ObjectReference, SkeletonResult für DII und DSI).
  • zerodds-corba-interop (nicht veröffentlicht) — Abhängigkeit von build.rs (erzeugt Rust aus der IDL der Feature-Matrix) und reguläre Abhängigkeit (seine Laufzeit implementiert CorbaConnection und AsyncCorbaChannel).

Status

  • Nur std; das Crate beschreibt sich selbst als Werkzeug, das beim Bauen läuft.
  • forbid(unsafe_code).
  • Nur Bibliothek, keine Binaries. Keine Cargo-Features.
  • 20 Testfunktionen in src/, 29 in tests/: 15 Snapshot-Tests (insta), 5 Tests der Kodierung des Value-Streams, 9 mit #[ignore] markierte Kompilierprüfungen, die cargo check über erzeugten Code laufen lassen.