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§
- Compose
Options - What the caller decides that the document does not.
- Composed
- What one composition produced.
- Diagnostic
- One thing wrong with a document.
Enums§
- Hashed
IdCounter - Re-exported because
ComposeOptionscarries them in public fields, exactly aszerodds-idl-composere-exports them: a caller that cannot name the type cannot construct the options. Whether a@hashidmember advances the sequential counter. - Hashed
Name Spelling - Re-exported because
ComposeOptionscarries them in public fields, exactly aszerodds-idl-composere-exports them: a caller that cannot name the type cannot construct the options. Which spelling of an escaped name a member-id hash reads. - KeyOn
Union Discriminator - Re-exported because
ComposeOptionscarries them in public fields, exactly aszerodds-idl-composere-exports them: a caller that cannot name the type cannot construct the options. Whether@keyon 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 namedtype_nameof the XML Type Representation indocument. - create_
type_ w_ uri - DDS-XTypes 1.3 §7.5.2.2.13
create_type_w_uri: the type namedtype_nameof the XML Type Representation atdocument_url. - xml_
path - The
<type-folder>/xml/<type-file>.xmla caller names by its two halves, which is the layout the OMGdds-xtypessuite uses.