Skip to main content

zerodds_corba_rt/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3
4//! Crate `zerodds-corba-rt`. Safety classification: **STANDARD**.
5//!
6//! OMG **Real-Time CORBA** 1.0 (`formal/2005-01-04`) — pure-Rust `no_std + alloc`,
7//! `forbid(unsafe_code)`. Brings deterministic real-time behavior to the CORBA
8//! model: end-to-end priority propagation, priority-aware thread pools
9//! and priority-banded connections.
10//!
11//! Implements:
12//! - **`Priority`** + **`PriorityMapping`** (§5.3/§5.4) — CORBA priority
13//!   (-32768..32767) ↔ native OS priority ([`priority`]).
14//! - **`PriorityModel`** (§5.4.1) — `SERVER_DECLARED` vs `CLIENT_PROPAGATED` +
15//!   `PriorityModelPolicy`; **Threadpool**/**Lane** (§5.7) + **PriorityBand**
16//!   (§5.8) with priority-based selection ([`policy`]).
17//! - **`RTCorbaPriority` ServiceContext** (id 10, §5.4.2) — propagation of the
18//!   client priority over GIOP ([`propagation`]).
19//! - **`RtCurrent`** (§5.5) — read/write access to the CORBA priority of the
20//!   current context ([`current`]).
21//! - **`RtMutex`** + **`PriorityInheritance`** (§5.6) — a blocking mutex
22//!   with a priority-inheritance protocol against priority inversion ([`mutex`]).
23//! - **`ThreadpoolRuntime`** (§5.7) — the runnable lanes-on-OS-threads
24//!   realization with an injectable native priority hook ([`threadpool`]).
25//! - **`TaskSet`** (scheduling profile) — static schedulability analysis
26//!   (Liu & Layland bound + exact response-time analysis) ([`scheduling`]).
27//!
28//! Spec: OMG Real-Time CORBA 1.0. Complementary to the DDS real-time QoS side
29//! (Deadline/Latency-Budget/Transport-Priority) for legacy CORBA code.
30
31#![no_std]
32#![forbid(unsafe_code)]
33#![cfg_attr(docsrs, feature(doc_cfg))]
34#![warn(missing_docs)]
35
36extern crate alloc;
37
38#[cfg(feature = "std")]
39extern crate std;
40
41pub mod current;
42pub mod mutex;
43pub mod policy;
44pub mod priority;
45pub mod propagation;
46pub mod scheduling;
47pub mod threadpool;
48
49pub use current::RtCurrent;
50pub use mutex::PriorityInheritance;
51pub use policy::{
52    Lane, PriorityBand, PriorityBandedConnectionPolicy, PriorityModel, PriorityModelPolicy,
53    Threadpool, ThreadpoolPolicy,
54};
55pub use priority::{LinearPriorityMapping, Priority, PriorityMapping};
56pub use propagation::{RT_CORBA_PRIORITY_SC_ID, decode_priority_context, encode_priority_context};
57pub use scheduling::{Task, TaskSet};
58
59#[cfg(feature = "std")]
60pub use mutex::{RtMutex, RtMutexGuard};
61#[cfg(feature = "std")]
62pub use threadpool::{DispatchError, NativePrioritySetter, ThreadpoolRuntime};