Skip to main content

zerodds_types/dynamic/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3//! XTypes 1.3 §7.5 DynamicType-API.
4//!
5//! Foundation for the XTypes 1.3 type-system completion. The goal is a
6//! programmatic, spec-faithful runtime view of XTypes data models
7//! (struct/union/enum/sequence/...) that lives independently of the
8//! `TypeObject` wire format — and can be mapped to the wire format via
9//! the `bridge` submodule (spec §7.6).
10//!
11//! # Module
12//!
13//! - `descriptor` — `TypeDescriptor`, `MemberDescriptor`, `TypeKind`,
14//!   `ExtensibilityKind`, `TryConstructKind`.
15//! - `type_` — `DynamicType`, `DynamicTypeMember`.
16//! - `builder` — `DynamicTypeBuilder`, `DynamicTypeBuilderFactory`.
17//! - `data` — `DynamicData` + 12 typed accessors + Sequence/Composite
18//!   + Loan-Stub.
19//! - `factory` — `DynamicDataFactory`.
20//! - `bridge` — TypeObject ↔ DynamicType.
21//! - `error` — `DynamicError`.
22//!
23//! # Implementation scope
24//!
25//! - Try-construct **apply** logic (DISCARD/USE_DEFAULT/TRIM on a
26//!   decoder failure) — comes with C4.7. Here only the enum +
27//!   member field.
28//! - Full loan refcount with lifetime tracking — the current
29//!   implementation is an RAII wrapper with an active set.
30//! - Annotations apply (spec §7.4 builtin annotations) — comes with
31//!   C4.3.
32//! - Bitset/bitmask in the bridge path — the TypeObject bridge for these
33//!   kinds follows with the C4.5 XML schema loader.
34
35pub mod bridge;
36pub mod builder;
37pub mod builtin_types;
38pub mod codec;
39pub mod collection;
40pub mod data;
41pub mod descriptor;
42pub mod error;
43pub mod factory;
44pub mod try_construct;
45pub mod type_;
46
47pub use builder::{DynamicTypeBuilder, DynamicTypeBuilderFactory};
48pub use builtin_types::{
49    NAME_DDS_BYTES, NAME_DDS_KEYED_BYTES, NAME_DDS_KEYED_STRING, NAME_DDS_STRING,
50    all_builtin_types, dds_bytes, dds_keyed_bytes, dds_keyed_string, dds_string,
51    is_builtin_type_name,
52};
53pub use data::{DataLoan, DynamicData, DynamicValue};
54pub use descriptor::{
55    ExtensibilityKind, MemberDescriptor, MemberId, TryConstructKind, TypeDescriptor, TypeKind,
56};
57pub use error::DynamicError;
58pub use factory::DynamicDataFactory;
59pub use try_construct::{TryConstructOutcome, apply_try_construct};
60pub use type_::{DynamicType, DynamicTypeMember};