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.
- Source: crates/corba-rust
- API docs: docs.rs/zerodds-corba-rust
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 stubIStub(holds anObjectReferenceand anArc<dyn CorbaConnection>) and the server skeletondispatch_<i>. Each generated skeleton first answers the sixCORBA::Objectoperations throughruntime::dispatch_object_operation.attribute T x→ getterfn x(&self), plusset_xunlessreadonly.- Parameters:
inby value,out/inoutas&mut;oneway→ method without reply;raises (…)→ a per-interface{I}Errorenum. valuetype V→pub trait V: ValueBaseplus marshalling;factory→ free function<v>_init_<name>; inheritance → trait bound, state flattened base first.component/home→ lifecycle trait and repository id. The container lifecycle beyondconfiguration_completeandccm_remove, and the receptacle, facet and event bindings, belong tozerodds-ccm.@amion an interface or operation →<Iface>AmiHandlerandsendc_<op>(callback model),sendp_<op>with a<Iface><Op>Poller(polling model), both overAsyncCorbaChannel.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, viazerodds-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::Objectoperations 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 featurestd(CorbaConnection,ObjectReference,SkeletonResultfor DII and DSI).zerodds-corba-interop(not published) — build-dependency (itsbuild.rsgenerates Rust from the feature-matrix IDL) and dependency (its runtime implementsCorbaConnectionandAsyncCorbaChannel).
Status
stdonly; 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 intests/: 15 snapshot tests (insta), 5 tests of the value stream encoding, 9 compile checks marked#[ignore]that runcargo checkover 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.
- Quelle: crates/corba-rust
- API-Docs: docs.rs/zerodds-corba-rust
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 ClientIStub(hält eineObjectReferenceund einArc<dyn CorbaConnection>) und das Skeleton für den Serverdispatch_<i>. Jedes erzeugte Skeleton beantwortet zuerst die sechsCORBA::Object-Operationen überruntime::dispatch_object_operation.attribute T x→ Getterfn x(&self), dazuset_x, sofern nichtreadonly.- Parameter:
inals Wert,out/inoutals&mut;oneway→ Methode ohne Antwort;raises (…)→ ein Enum{I}Errorje Interface. valuetype V→pub trait V: ValueBasesamt 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 überconfiguration_completeundccm_removehinaus sowie die Bindungen für Receptacles, Facets und Events gehören zuzerodds-ccm.@amian einem Interface oder einer Operation →<Iface>AmiHandlerundsendc_<op>(Rückrufmodell),sendp_<op>mit einem<Iface><Op>Poller(Abfragemodell), beide überAsyncCorbaChannel.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, überzerodds-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 Featurestd(Standard) (CorbaConnection,ObjectReference,SkeletonResultfür DII und DSI).zerodds-corba-interop(nicht veröffentlicht) — Abhängigkeit vonbuild.rs(erzeugt Rust aus der IDL der Feature-Matrix) und reguläre Abhängigkeit (seine Laufzeit implementiertCorbaConnectionundAsyncCorbaChannel).
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 intests/: 15 Snapshot-Tests (insta), 5 Tests der Kodierung des Value-Streams, 9 mit#[ignore]markierte Kompilierprüfungen, diecargo checküber erzeugten Code laufen lassen.