zerodds_web/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3
4//! OMG DDS-WEB 1.0 — Web-Enabled DDS Object Model + REST PSM.
5//!
6//! Crate `zerodds-web`. Safety classification: **STANDARD**.
7//! Spec `formal/2014-12-01` (`internal/standards/cache/omg/zerodds-web-1.0.pdf`).
8//!
9//! # Scope
10//!
11//! We implement the **WebDDS object model** (Spec §7) and the
12//! **REST PSM** (Spec §8.3) as a pure-Rust no_std+alloc library:
13//!
14//! * `WebDDS::Root` singleton + `Application` + `Client` +
15//! `AccessController` + `DomainParticipant` (§7.3 object model).
16//! * `ReturnStatus` with all spec codes (§7.3.1 + §8.3.2 mapping to
17//! HTTP status).
18//! * `RestRoute` parser for all URI patterns from Spec §8.3.1
19//! Tab 4 + §8.3.3 Tab 5 (all 30+ routes with parameter extraction).
20//! * `Representation` XML element-name registry (Spec §8.3.4 Tab 6).
21//! * `Headers` HTTP request/response header set (Spec §8.3.5 Tab 7+8).
22//! * `SessionId` authenticated-session tracking (§7.3.1.1).
23//!
24//! # What is not covered
25//!
26//! * **HTTP server implementation** — caller layer (typically
27//! `axum`/`hyper`); this crate provides routing tables + status
28//! mapping, the caller binds to the HTTP stack.
29//! * **XML body serialization** — caller layer with the `crates/xml/`
30//! loader + DDS-XTYPES type-definition reader; the XML element-name
31//! registry here provides the wire tags.
32//! * **WebSocket push for DataReader notifications** — see
33//! `crates/websocket-bridge/`; the caller wires it via a listener
34//! callback from `crates/dcps/`.
35//! * **SOAP/WSDL-Platform** (Spec §8.4) — `n/a` (REST ist mandatory,
36//! SOAP is optional + rarely used).
37
38#![forbid(unsafe_code)]
39#![warn(missing_docs)]
40
41extern crate alloc;
42
43pub mod access_control;
44pub mod bridge;
45pub mod headers;
46pub mod model;
47pub mod representation;
48pub mod rest;
49pub mod sample_selector;
50pub mod session;
51pub mod status;
52
53pub use access_control::{Decision, Operation, Permissions, Rule};
54pub use bridge::{BackendError, BackendResult, DdsBackend, enforce};
55pub use headers::{REQUEST_API_KEY, RequestHeaders, ResponseHeaders};
56pub use model::{Application, Client, DomainParticipant, WebDdsRoot};
57pub use representation::{ContentType, RepresentationKind, element_name};
58pub use rest::{REST_PREFIX, RestMethod, RestRoute, parse_route};
59pub use sample_selector::{
60 BoolOp, CompareOp, FilterExpression, InstanceStateMatch, Literal, MetadataExpression,
61 ParseError as SampleSelectorParseError, SampleSelector, SampleStateMatch, ViewStateMatch,
62 parse_sample_selector,
63};
64pub use session::SessionId;
65pub use status::{ReturnStatus, http_status_for};