1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 ZeroDDS Contributors
//! Crate `zerodds-py`. Safety classification: **STANDARD** (Binding-FFI).
//!
//! PyO3 bindings for the ZeroDDS DCPS API. Provides an importable
//! Python module `zerodds_py` via `maturin build` or directly via
//! `cargo build --features extension-module`.
//!
//! Spec: OMG DDS 1.4 (formal/2015-04-10) §2.2.2 with Python idioms.
//!
//! ## Layer position
//!
//! Layer 6 — PSMs / bindings.
//!
//! ## Build
//!
//! - **Default cargo build** (without Python headers): pyo3 is optional,
//! the crate compiles as a lib placeholder. No Python API
//! available — this is how the workspace CI runs without a Python dependency.
//! - **With `--features extension-module`** (or via `maturin build`):
//! compiled as a `cdylib` and produces an importable
//! Python module `zerodds_py`.
//!
//! ## API
//!
//! ```python
//! import zerodds_py as zerodds
//!
//! factory = zerodds.DomainParticipantFactory.instance()
//! participant = factory.create_participant_offline(0)
//!
//! topic = participant.create_bytes_topic("Chatter")
//! publisher = participant.create_publisher()
//! writer = publisher.create_bytes_writer(topic)
//!
//! subscriber = participant.create_subscriber()
//! reader = subscriber.create_bytes_reader(topic)
//!
//! writer.write(b"hello")
//! samples = reader.take() # List[bytes]
//! ```
//!
//! Typed `DdsType` bindings (dataclass mapping via the IDL generator)
//! follow from `crates/idl-rust` through the Python bindings generator.