Skip to main content

Crate zerodds_xml_compose

Crate zerodds_xml_compose 

Source
Expand description

DDS-XML type definitions into the common AST.

Crate zerodds-xml-compose. Safety classification: STANDARD. Build-time only, std, forbid(unsafe_code).

One call — compose — takes a path to a DDS-XML document and produces the same Ast that zerodds-idl-compose produces from an .idl file, plus the type objects the model registers. Everything downstream of the model — zerodds_types::from_ast, the layout planner, zerodds-wire-codec, every code generator — reads the model and does not know or care which front end filled it.

§Why a crate of its own rather than more of zerodds-xml

zerodds-xml reads DDS-XML already, and stops one layer short: it builds its own descriptive zerodds_xml::TypeLibrary and bridges that to a MinimalTypeObject. That layer is a published API with its own users, and it drops exactly what a model needs — a member carries no tryConstruct, no hashid and no external, a struct carries no autoid, an enum carries neither extensibility nor defaultLiteral, a union carries no extensibility and no discriminator key, and its primitive table has no int8/uint8 at all. Widening those structs would change signatures every current caller compiles against.

So this crate takes the same position against zerodds-xml that zerodds-idl-compose takes against zerodds-idl-parse: it reuses the front end’s well-formedness layer — zerodds_xml::parse_xml_tree and its element tree, with the DDS-XML 1.0 §7.1 depth cap, element budget and namespace handling — and lowers that tree into the model itself. Nothing in zerodds-xml changes.

§Spec sources

  • OMG DDS-XML 1.0 (formal/18-10-01) §7.1 (representation syntax), §7.3.3 (Types building block).
  • OMG DDS-XTypes 1.3 Annex A (XML Type Representation) for the type grammar the <types> element carries, and §7.3.1.2.1 for what the attributes mean.
  • OMG IDL 4.2 §7.4 where the two representations share a rule.

Structs§

ComposeOptions
What the caller decides that the document does not.
Composed
What one composition produced.
Diagnostic
One thing wrong with a document.

Enums§

HashedIdCounter
Re-exported because ComposeOptions carries them in public fields, exactly as zerodds-idl-compose re-exports them: a caller that cannot name the type cannot construct the options. Whether a @hashid member advances the sequential counter.
HashedNameSpelling
Re-exported because ComposeOptions carries them in public fields, exactly as zerodds-idl-compose re-exports them: a caller that cannot name the type cannot construct the options. Which spelling of an escaped name a member-id hash reads.
KeyOnUnionDiscriminator
Re-exported because ComposeOptions carries them in public fields, exactly as zerodds-idl-compose re-exports them: a caller that cannot name the type cannot construct the options. Whether @key on a union discriminator is carried into the model.
Severity
How bad one finding is.

Functions§

compose
Compose one DDS-XML document from a path.
compose_all
Compose several documents into one model.
compose_all_sources
As compose_all, over text the caller already has.
compose_source
As compose, over text the caller already has.
compose_source_with
As compose_source, deciding what the document leaves open.
compose_with
As compose, deciding what the document leaves open.
create_type_w_document
DDS-XTypes 1.3 §7.5.2.2.14 create_type_w_document: the type named type_name of the XML Type Representation in document.
create_type_w_uri
DDS-XTypes 1.3 §7.5.2.2.13 create_type_w_uri: the type named type_name of the XML Type Representation at document_url.
xml_path
The <type-folder>/xml/<type-file>.xml a caller names by its two halves, which is the layout the OMG dds-xtypes suite uses.