zerodds_opcua_pubsub/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3
4//! OPC-UA Pub/Sub **Part 14** (UADP) — native pure-Rust wire stack.
5//!
6//! Crate `zerodds-opcua-pubsub`. Safety classification: **STANDARD**.
7//! Spec: OPC Foundation **Part 14 — PubSub** + **Part 6 — Mappings**
8//! (binary encoding).
9//!
10//! # Scope and relationship to `zerodds-opcua-gateway`
11//!
12//! [`zerodds-opcua-gateway`](https://docs.rs/zerodds-opcua-gateway) is
13//! the OMG **DDS-OPCUA 1.0** bridge — a pure type-system + AddressSpace
14//! *mapping* library with no wire I/O. This crate adds the OPC Foundation
15//! **Part 14** Pub/Sub *transport*: it serialises the gateway type model
16//! (`NodeId`, `Variant`, `DataValue`, …) into the OPC-UA binary encoding
17//! and frames it as UADP `NetworkMessage`s.
18//!
19//! The two specs are distinct families: DDS-OPCUA 1.0 bridges OPC-UA into
20//! the DDS global data space; Part 14 is OPC-UA's own publish/subscribe
21//! wire protocol. This crate is therefore an additive profile, not a
22//! change to the gateway.
23//!
24//! # Layering (built incrementally)
25//!
26//! 1. [`binary`] — OPC-UA Part 6 binary encoding (the foundation; also
27//! usable by the Client/Server gateway).
28//! 2. UADP `NetworkMessage` / `DataSetMessage` framing.
29//! 3. PubSub configuration model + `DataSetWriter` / `DataSetReader`.
30//! 4. UADP discovery (`DataSetMetaData`).
31//! 5. PubSub security (`SecurityGroup` + Security Key Service).
32//! 6. Transport carriers (UDP multicast, Ethernet, MQTT/AMQP).
33//! 7. DataSet ↔ DDS-topic bridge + daemon.
34
35#![cfg_attr(not(feature = "std"), no_std)]
36#![forbid(unsafe_code)]
37#![warn(missing_docs)]
38// Tests may panic/expect/unwrap freely; production code stays strict
39// (the workspace denies these globally).
40#![cfg_attr(test, allow(clippy::expect_used, clippy::unwrap_used, clippy::panic))]
41
42extern crate alloc;
43
44pub mod binary;
45pub mod bridge;
46pub mod config;
47pub mod daemon;
48pub mod dynamic;
49pub mod error;
50pub mod infomodel;
51#[cfg(feature = "json")]
52pub mod json;
53pub mod reader;
54#[cfg(feature = "security")]
55pub mod security;
56pub mod transport;
57pub mod uadp;
58pub mod writer;
59
60pub use binary::{UaDecode, UaEncode, UaReader, UaWriter, from_binary, to_binary};
61pub use error::{DecodeError, EncodeError};