zerodds_rtc/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3
4//! OMG RTC 1.0 — Robotic Technology Component.
5//!
6//! Crate `zerodds-rtc`. Safety classification: **STANDARD**.
7//! Spec `formal/2008-04-04` (`internal/standards/cache/omg/rtc-1.0.pdf`).
8//!
9//! # Scope
10//!
11//! Implemented are: lightweight RTC, execution semantics
12//! (periodic / stimulus response / modes), local PSM
13//! (§5.2 + §5.3 + §6.3) as a Rust library. The local PSM is explicitly
14//! "Components on same network node, direct object refs without
15//! CORBA-mediated middleware" (spec §1.3 point 1, p. 2) and thus
16//! ZeroDDS-conformant.
17//!
18//! # What is not covered
19//!
20//! * **CORBA PSM** (§6.5) — requires a CORBA ORB; ZeroDDS has none.
21//! * **Lightweight CCM PSM** (§6.4) — requires an LwCCM container; see
22//! `crates/ccm/` which provides the IDL-equivalent transformation
23//! but no container.
24//! * **Introspection §5.4 Resource Data Model** — partial: the
25//! data model is in the crate, the discovery/wire aspect is not.
26//!
27//! # Modules
28//!
29//! * [`return_code`] — `ReturnCode_t` (spec §5.2.1).
30//! * [`lifecycle`] — `LifeCycleState`, `ExecutionKind`, `ComponentAction`
31//! trait + state-machine enforcement (spec §5.2.2.3 / §5.2.2.7 /
32//! §5.2.2.4).
33//! * [`object`] — `LightweightRTObject` model (spec §5.2.2.2) +
34//! `ExecutionContextHandle_t` (spec §5.2.2.8).
35//! * [`execution`] — `ExecutionContext` + `ExecutionContextOperations`
36//! (spec §5.2.2.5 / §5.2.2.6).
37//! * [`semantics`] — execution-kind profiles (periodic/stimulus/modes,
38//! spec §5.3).
39//!
40//! # Example
41//!
42//! ```
43//! use zerodds_rtc::ReturnCode;
44//!
45//! // Spec §5.2.1.1: ReturnCode::Ok is the only OK code.
46//! assert!(ReturnCode::Ok.is_ok());
47//! assert!(!ReturnCode::PreconditionNotMet.is_ok());
48//! assert_eq!(ReturnCode::Ok.into_result(), Ok(()));
49//! ```
50
51#![forbid(unsafe_code)]
52#![warn(missing_docs)]
53
54extern crate alloc;
55
56pub mod execution;
57pub mod lifecycle;
58pub mod object;
59pub mod resource;
60pub mod return_code;
61pub mod semantics;
62
63pub use execution::{ExecutionContext, ExecutionContextOperations};
64pub use lifecycle::{ComponentAction, ExecutionKind, LifeCycleState};
65pub use object::{ExecutionContextHandle, LightweightRtObject};
66pub use resource::{
67 ComponentProfile, ConnectorProfile, Introspection, PortDirection, PortProfile, ProfileId,
68};
69pub use return_code::ReturnCode;
70pub use semantics::{
71 DataFlowComponentAction, FsmComponentAction, ModeOfOperation, MultiModeComponentAction,
72};