zerodds_corba_cos_event/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3
4//! Crate `zerodds-corba-cos-event`. Safety classification: **STANDARD**.
5//!
6//! OMG CosEventService 1.4 (`formal/2004-10-02`) voller Stack —
7//! pure-Rust `no_std + alloc`, `forbid(unsafe_code)`. Implementiert:
8//!
9//! - **CosEventComm** (Spec §1.5): PushConsumer, PushSupplier,
10//! PullConsumer, PullSupplier mit Disconnect-Operations.
11//! - **CosEventChannelAdmin** (Spec §1.6): EventChannel,
12//! ConsumerAdmin, SupplierAdmin, ProxyPushConsumer/Supplier,
13//! ProxyPullConsumer/Supplier.
14//! - **CosTypedEventComm + CosTypedEventChannelAdmin** (Spec §2):
15//! TypedPushConsumer/Supplier mit `get_typed_consumer/supplier`-
16//! Operations.
17//! - **AnyEvent**: opaque Event-Container fuer den Push-Modus.
18//!
19//! Spec: OMG CosEventService 1.4 (`formal/2004-10-02`) §1.5 + §1.6 + §2.
20//!
21//! ## Schichten-Position
22//!
23//! Layer 8 — CORBA-Stack (Tier-A). Caller-Layer (Daemon o.ae.)
24//! konstruiert konkrete Channel-Instanzen, registriert Suppliers
25//! und Consumers, und treibt die Connect/Disconnect-Lifecycle.
26//!
27//! ## Public API (Stand 1.0.0-rc.1)
28//!
29//! - [`AnyEvent`] / [`Disconnected`] / [`ConnectError`] — Event-Body
30//! und Spec-§1.5-Errors.
31//! - [`PushConsumer`] / [`PushSupplier`] / [`PullConsumer`] /
32//! [`PullSupplier`] — Spec §1.5 Trait-Surfaces.
33//! - [`EventChannel`] / [`ConsumerAdmin`] / [`SupplierAdmin`] /
34//! [`ProxyPushConsumer`] / [`ProxyPushSupplier`] /
35//! [`ProxyPullConsumer`] / [`ProxyPullSupplier`] — Spec §1.6.
36//! - [`TypedEventChannel`] / [`TypedPushConsumer`] /
37//! [`TypedPushSupplier`] — Spec §2.
38//!
39//! ## Beispiel
40//!
41//! ```rust
42//! use zerodds_corba_cos_event::{AnyEvent, EventChannel};
43//!
44//! let _channel = EventChannel::new();
45//! let event = AnyEvent::new("IDL:Foo:1.0".to_string(), vec![1, 2, 3]);
46//! assert_eq!(event.type_id, "IDL:Foo:1.0");
47//! assert_eq!(event.data, vec![1, 2, 3]);
48//! ```
49
50#![cfg_attr(not(feature = "std"), no_std)]
51#![forbid(unsafe_code)]
52#![warn(missing_docs)]
53
54#[cfg(feature = "alloc")]
55extern crate alloc;
56
57pub mod channel;
58pub mod comm;
59pub mod typed;
60
61pub use channel::{
62 ConsumerAdmin, EventChannel, ProxyPullConsumer, ProxyPullSupplier, ProxyPushConsumer,
63 ProxyPushSupplier, SupplierAdmin,
64};
65pub use comm::{
66 AnyEvent, ConnectError, Disconnected, PullConsumer, PullSupplier, PushConsumer, PushSupplier,
67};
68pub use typed::{TypedEventChannel, TypedPushConsumer, TypedPushSupplier};