Skip to main content

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` (`docs/standards/cache/omg/rtc-1.0.pdf`).
8//!
9//! # Scope
10//!
11//! Implementiert sind: Lightweight RTC, Execution Semantics
12//! (Periodic / Stimulus Response / Modes), Local PSM
13//! (§5.2 + §5.3 + §6.3) als Rust-Library. Das Local PSM ist explizit
14//! "Components on same network node, direct object refs without
15//! CORBA-mediated middleware" (Spec §1.3 Punkt 1, S. 2) und damit
16//! ZeroDDS-konform.
17//!
18//! # Was nicht abgedeckt ist
19//!
20//! * **CORBA PSM** (§6.5) — verlangt CORBA-ORB; ZeroDDS hat keinen.
21//! * **Lightweight CCM PSM** (§6.4) — verlangt LwCCM-Container; siehe
22//!   `crates/ccm/` welche die IDL-Equivalent-Transformation liefert,
23//!   aber keinen Container bereitstellt.
24//! * **Introspection §5.4 Resource Data Model** — partial: das
25//!   Datenmodell ist im Crate, der Discovery-/Wire-Aspekt nicht.
26//!
27//! # Module
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`-Modell (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-Profile (Periodic/Stimulus/Modes,
38//!   Spec §5.3).
39//!
40//! # Beispiel
41//!
42//! ```
43//! use zerodds_rtc::ReturnCode;
44//!
45//! // Spec §5.2.1.1: ReturnCode::Ok ist der einzige 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};