rustorb-dds 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. rustorb_dds-0.1.0/Cargo.lock +201 -0
  2. rustorb_dds-0.1.0/Cargo.toml +33 -0
  3. rustorb_dds-0.1.0/PKG-INFO +85 -0
  4. rustorb_dds-0.1.0/README.md +71 -0
  5. rustorb_dds-0.1.0/crates/rustorb-dds/Cargo.toml +23 -0
  6. rustorb_dds-0.1.0/crates/rustorb-dds/examples/dynamic/main.rs +134 -0
  7. rustorb_dds-0.1.0/crates/rustorb-dds/examples/evolve/main.rs +171 -0
  8. rustorb_dds-0.1.0/crates/rustorb-dds/examples/evolve/v1.rs +264 -0
  9. rustorb_dds-0.1.0/crates/rustorb-dds/examples/evolve/v2.rs +306 -0
  10. rustorb_dds-0.1.0/crates/rustorb-dds/examples/hello_world/greeting.rs +100 -0
  11. rustorb_dds-0.1.0/crates/rustorb-dds/examples/hello_world/main.rs +203 -0
  12. rustorb_dds-0.1.0/crates/rustorb-dds/examples/keyed/main.rs +141 -0
  13. rustorb_dds-0.1.0/crates/rustorb-dds/examples/keyed/shape.rs +98 -0
  14. rustorb_dds-0.1.0/crates/rustorb-dds/examples/liveliness/main.rs +155 -0
  15. rustorb_dds-0.1.0/crates/rustorb-dds/examples/ros2/main.rs +128 -0
  16. rustorb_dds-0.1.0/crates/rustorb-dds/examples/ros2/std_msgs.rs +81 -0
  17. rustorb_dds-0.1.0/crates/rustorb-dds/src/condition.rs +429 -0
  18. rustorb_dds-0.1.0/crates/rustorb-dds/src/error.rs +77 -0
  19. rustorb_dds-0.1.0/crates/rustorb-dds/src/instance.rs +853 -0
  20. rustorb_dds-0.1.0/crates/rustorb-dds/src/lib.rs +114 -0
  21. rustorb_dds-0.1.0/crates/rustorb-dds/src/listener.rs +60 -0
  22. rustorb_dds-0.1.0/crates/rustorb-dds/src/participant.rs +2161 -0
  23. rustorb_dds-0.1.0/crates/rustorb-dds/src/publisher.rs +455 -0
  24. rustorb_dds-0.1.0/crates/rustorb-dds/src/qos.rs +274 -0
  25. rustorb_dds-0.1.0/crates/rustorb-dds/src/status.rs +410 -0
  26. rustorb_dds-0.1.0/crates/rustorb-dds/src/subscriber.rs +521 -0
  27. rustorb_dds-0.1.0/crates/rustorb-dds/src/topic.rs +62 -0
  28. rustorb_dds-0.1.0/crates/rustorb-dds/src/typed.rs +243 -0
  29. rustorb_dds-0.1.0/crates/rustorb-dds/tests/instances.rs +255 -0
  30. rustorb_dds-0.1.0/crates/rustorb-dds/tests/large.rs +140 -0
  31. rustorb_dds-0.1.0/crates/rustorb-dds/tests/liveliness.rs +270 -0
  32. rustorb_dds-0.1.0/crates/rustorb-dds/tests/pubsub.rs +193 -0
  33. rustorb_dds-0.1.0/crates/rustorb-dds/tests/qos.rs +229 -0
  34. rustorb_dds-0.1.0/crates/rustorb-dds/tests/reliable.rs +274 -0
  35. rustorb_dds-0.1.0/crates/rustorb-dds/tests/waitset.rs +436 -0
  36. rustorb_dds-0.1.0/crates/rustorb-dds/tests/xtypes.rs +456 -0
  37. rustorb_dds-0.1.0/crates/rustorb-dds-python/Cargo.toml +33 -0
  38. rustorb_dds-0.1.0/crates/rustorb-dds-python/build.rs +7 -0
  39. rustorb_dds-0.1.0/crates/rustorb-dds-python/src/entity.rs +1203 -0
  40. rustorb_dds-0.1.0/crates/rustorb-dds-python/src/lib.rs +28 -0
  41. rustorb_dds-0.1.0/crates/rustorb-dds-python/src/types.rs +444 -0
  42. rustorb_dds-0.1.0/crates/rustorb-dds-python/src/value.rs +384 -0
  43. rustorb_dds-0.1.0/crates/rustorb-rtps/Cargo.toml +20 -0
  44. rustorb_dds-0.1.0/crates/rustorb-rtps/src/error.rs +132 -0
  45. rustorb_dds-0.1.0/crates/rustorb-rtps/src/frag.rs +507 -0
  46. rustorb_dds-0.1.0/crates/rustorb-rtps/src/lib.rs +80 -0
  47. rustorb_dds-0.1.0/crates/rustorb-rtps/src/message.rs +244 -0
  48. rustorb_dds-0.1.0/crates/rustorb-rtps/src/parameter.rs +235 -0
  49. rustorb_dds-0.1.0/crates/rustorb-rtps/src/pl.rs +480 -0
  50. rustorb_dds-0.1.0/crates/rustorb-rtps/src/qos.rs +495 -0
  51. rustorb_dds-0.1.0/crates/rustorb-rtps/src/receiver.rs +127 -0
  52. rustorb_dds-0.1.0/crates/rustorb-rtps/src/reliable.rs +1705 -0
  53. rustorb_dds-0.1.0/crates/rustorb-rtps/src/sedp.rs +1635 -0
  54. rustorb_dds-0.1.0/crates/rustorb-rtps/src/spdp.rs +755 -0
  55. rustorb_dds-0.1.0/crates/rustorb-rtps/src/submessage.rs +1048 -0
  56. rustorb_dds-0.1.0/crates/rustorb-rtps/src/typelookup.rs +639 -0
  57. rustorb_dds-0.1.0/crates/rustorb-rtps/src/types.rs +862 -0
  58. rustorb_dds-0.1.0/crates/rustorb-rtps/src/udp.rs +554 -0
  59. rustorb_dds-0.1.0/crates/rustorb-rtps/src/wire.rs +175 -0
  60. rustorb_dds-0.1.0/crates/rustorb-rtps/src/wlp.rs +444 -0
  61. rustorb_dds-0.1.0/crates/rustorb-rtps/tests/messages.rs +684 -0
  62. rustorb_dds-0.1.0/crates/rustorb-rtps/tests/sedp_udp.rs +135 -0
  63. rustorb_dds-0.1.0/crates/rustorb-rtps/tests/spdp_udp.rs +92 -0
  64. rustorb_dds-0.1.0/crates/rustorb-rtps/tests/udp.rs +141 -0
  65. rustorb_dds-0.1.0/crates/rustorb-xtypes/Cargo.toml +20 -0
  66. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/assignability.rs +1244 -0
  67. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/dynamic/cdr.rs +868 -0
  68. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/dynamic/convert.rs +536 -0
  69. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/dynamic/data.rs +1217 -0
  70. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/dynamic/mod.rs +39 -0
  71. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/dynamic/ty.rs +855 -0
  72. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/lib.rs +79 -0
  73. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/registry.rs +181 -0
  74. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/type_object.rs +1867 -0
  75. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/typelookup.rs +556 -0
  76. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/types.rs +1156 -0
  77. rustorb_dds-0.1.0/crates/rustorb-xtypes/src/xcdr2.rs +228 -0
  78. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/cyclonedds.rs +523 -0
  79. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/dynamic.rs +406 -0
  80. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fixtures.idl +41 -0
  81. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_All.typeinfo +23 -0
  82. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_All.typemap +148 -0
  83. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Derived.typeinfo +5 -0
  84. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Derived.typemap +12 -0
  85. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Hashed.typeinfo +4 -0
  86. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Hashed.typemap +10 -0
  87. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Inner.typeinfo +4 -0
  88. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Inner.typemap +8 -0
  89. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Mut.typeinfo +5 -0
  90. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Mut.typemap +17 -0
  91. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Plain.typeinfo +4 -0
  92. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Plain.typemap +21 -0
  93. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Top.typeinfo +25 -0
  94. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_Top.typemap +155 -0
  95. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_U.typeinfo +5 -0
  96. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_U.typemap +18 -0
  97. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_UE.typeinfo +7 -0
  98. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Fx_UE.typemap +23 -0
  99. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_All.typeinfo +20 -0
  100. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_All.typemap +132 -0
  101. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Hashed.typeinfo +4 -0
  102. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Hashed.typemap +10 -0
  103. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Inner.typeinfo +4 -0
  104. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Inner.typemap +8 -0
  105. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Mut.typeinfo +5 -0
  106. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Mut.typemap +17 -0
  107. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Plain.typeinfo +4 -0
  108. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Plain.typemap +18 -0
  109. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Top.typeinfo +22 -0
  110. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_Top.typemap +140 -0
  111. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_U.typeinfo +5 -0
  112. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_U.typemap +18 -0
  113. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_UE.typeinfo +7 -0
  114. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Gen_UE.typemap +23 -0
  115. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Generated.idl +42 -0
  116. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/HelloWorld.idl +12 -0
  117. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/HelloWorld_Greeting.typeinfo +4 -0
  118. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/HelloWorld_Greeting.typemap +8 -0
  119. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Keyed.idl +10 -0
  120. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Keyed_Shape.typeinfo +4 -0
  121. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/Keyed_Shape.typemap +9 -0
  122. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/README.md +62 -0
  123. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/idlc-version.txt +1 -0
  124. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/fixtures/cyclonedds/update.sh +31 -0
  125. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/generated/generated.rs +1755 -0
  126. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/generated/hello_world.rs +127 -0
  127. rustorb_dds-0.1.0/crates/rustorb-xtypes/tests/generated/keyed.rs +136 -0
  128. rustorb_dds-0.1.0/pyproject.toml +26 -0
  129. rustorb_dds-0.1.0/rustorb_dds/__init__.py +567 -0
  130. rustorb_dds-0.1.0/rustorb_dds/types.py +679 -0
@@ -0,0 +1,201 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "heck"
7
+ version = "0.5.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
10
+
11
+ [[package]]
12
+ name = "libc"
13
+ version = "0.2.191"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
16
+
17
+ [[package]]
18
+ name = "once_cell"
19
+ version = "1.21.4"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
22
+
23
+ [[package]]
24
+ name = "portable-atomic"
25
+ version = "1.15.0"
26
+ source = "registry+https://github.com/rust-lang/crates.io-index"
27
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
28
+
29
+ [[package]]
30
+ name = "proc-macro2"
31
+ version = "1.0.107"
32
+ source = "registry+https://github.com/rust-lang/crates.io-index"
33
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
34
+ dependencies = [
35
+ "unicode-ident",
36
+ ]
37
+
38
+ [[package]]
39
+ name = "pyo3"
40
+ version = "0.30.1"
41
+ source = "registry+https://github.com/rust-lang/crates.io-index"
42
+ checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
43
+ dependencies = [
44
+ "libc",
45
+ "once_cell",
46
+ "portable-atomic",
47
+ "pyo3-build-config",
48
+ "pyo3-ffi",
49
+ "pyo3-macros",
50
+ ]
51
+
52
+ [[package]]
53
+ name = "pyo3-build-config"
54
+ version = "0.30.1"
55
+ source = "registry+https://github.com/rust-lang/crates.io-index"
56
+ checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
57
+ dependencies = [
58
+ "target-lexicon",
59
+ ]
60
+
61
+ [[package]]
62
+ name = "pyo3-ffi"
63
+ version = "0.30.1"
64
+ source = "registry+https://github.com/rust-lang/crates.io-index"
65
+ checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
66
+ dependencies = [
67
+ "libc",
68
+ "pyo3-build-config",
69
+ ]
70
+
71
+ [[package]]
72
+ name = "pyo3-macros"
73
+ version = "0.30.1"
74
+ source = "registry+https://github.com/rust-lang/crates.io-index"
75
+ checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
76
+ dependencies = [
77
+ "proc-macro2",
78
+ "pyo3-macros-backend",
79
+ "quote",
80
+ "syn",
81
+ ]
82
+
83
+ [[package]]
84
+ name = "pyo3-macros-backend"
85
+ version = "0.30.1"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
88
+ dependencies = [
89
+ "heck",
90
+ "proc-macro2",
91
+ "quote",
92
+ "syn",
93
+ ]
94
+
95
+ [[package]]
96
+ name = "quote"
97
+ version = "1.0.47"
98
+ source = "registry+https://github.com/rust-lang/crates.io-index"
99
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
100
+ dependencies = [
101
+ "proc-macro2",
102
+ ]
103
+
104
+ [[package]]
105
+ name = "rustorb-cdr"
106
+ version = "0.2.0"
107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
108
+ checksum = "f4a04f61a080b2c9b42b9c79d4bcc0ea2fd4a8168c0602fdee919edd5e6e60e8"
109
+
110
+ [[package]]
111
+ name = "rustorb-dds"
112
+ version = "0.0.0"
113
+ dependencies = [
114
+ "rustorb-rtps",
115
+ "rustorb-typesupport",
116
+ "rustorb-xtypes",
117
+ ]
118
+
119
+ [[package]]
120
+ name = "rustorb-dds-python"
121
+ version = "0.0.0"
122
+ dependencies = [
123
+ "pyo3",
124
+ "pyo3-build-config",
125
+ "rustorb-dds",
126
+ "rustorb-xtypes",
127
+ ]
128
+
129
+ [[package]]
130
+ name = "rustorb-rtps"
131
+ version = "0.0.0"
132
+ dependencies = [
133
+ "rustorb-cdr",
134
+ "rustorb-xtypes",
135
+ "socket2",
136
+ ]
137
+
138
+ [[package]]
139
+ name = "rustorb-typesupport"
140
+ version = "0.2.0"
141
+ source = "registry+https://github.com/rust-lang/crates.io-index"
142
+ checksum = "8e68ddaa3eeecf15cb112bc236925de7b916a964926a25dcb8c72d8a0bf4efc8"
143
+ dependencies = [
144
+ "rustorb-cdr",
145
+ ]
146
+
147
+ [[package]]
148
+ name = "rustorb-xtypes"
149
+ version = "0.0.0"
150
+ dependencies = [
151
+ "rustorb-cdr",
152
+ "rustorb-typesupport",
153
+ ]
154
+
155
+ [[package]]
156
+ name = "socket2"
157
+ version = "0.6.5"
158
+ source = "registry+https://github.com/rust-lang/crates.io-index"
159
+ checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
160
+ dependencies = [
161
+ "libc",
162
+ "windows-sys",
163
+ ]
164
+
165
+ [[package]]
166
+ name = "syn"
167
+ version = "3.0.9"
168
+ source = "registry+https://github.com/rust-lang/crates.io-index"
169
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
170
+ dependencies = [
171
+ "proc-macro2",
172
+ "quote",
173
+ "unicode-ident",
174
+ ]
175
+
176
+ [[package]]
177
+ name = "target-lexicon"
178
+ version = "0.13.5"
179
+ source = "registry+https://github.com/rust-lang/crates.io-index"
180
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
181
+
182
+ [[package]]
183
+ name = "unicode-ident"
184
+ version = "1.0.27"
185
+ source = "registry+https://github.com/rust-lang/crates.io-index"
186
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
187
+
188
+ [[package]]
189
+ name = "windows-link"
190
+ version = "0.2.1"
191
+ source = "registry+https://github.com/rust-lang/crates.io-index"
192
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
193
+
194
+ [[package]]
195
+ name = "windows-sys"
196
+ version = "0.61.2"
197
+ source = "registry+https://github.com/rust-lang/crates.io-index"
198
+ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
199
+ dependencies = [
200
+ "windows-link",
201
+ ]
@@ -0,0 +1,33 @@
1
+ [workspace]
2
+ resolver = "3"
3
+ members = ["crates/rustorb-xtypes", "crates/rustorb-rtps", "crates/rustorb-dds", "crates/rustorb-dds-python"]
4
+ exclude = ["fuzz"]
5
+
6
+ [workspace.package]
7
+ version = "0.0.0"
8
+ edition = "2024"
9
+ rust-version = "1.85"
10
+ license = "MIT OR Apache-2.0"
11
+ repository = "https://github.com/rustorb/rustorb-dds"
12
+ homepage = "https://github.com/rustorb/rustorb-dds"
13
+ keywords = ["dds", "rtps", "ddsi", "pubsub", "ros2"]
14
+ categories = ["network-programming"]
15
+
16
+ [workspace.dependencies]
17
+ rustorb-xtypes = { path = "crates/rustorb-xtypes" }
18
+ rustorb-rtps = { path = "crates/rustorb-rtps" }
19
+ # Socket options std lacks (SO_REUSEADDR before bind, IP_MULTICAST_IF).
20
+ # MIT OR Apache-2.0.
21
+ socket2 = { version = "0.6", features = ["all"] }
22
+ # The shared parts of rustorb, released in 0.2.0 (rustorb/rustorb#114).
23
+ # Both are MIT OR Apache-2.0; the GPL generator is never a dependency.
24
+ rustorb-cdr = "0.2.0"
25
+ rustorb-typesupport = "0.2.0"
26
+
27
+ [workspace.lints.rust]
28
+ unsafe_op_in_unsafe_fn = "deny"
29
+ missing_debug_implementations = "warn"
30
+ missing_docs = "warn"
31
+
32
+ [workspace.lints.clippy]
33
+ all = { level = "warn", priority = -1 }
@@ -0,0 +1,85 @@
1
+ Metadata-Version: 2.4
2
+ Name: rustorb-dds
3
+ Version: 0.1.0
4
+ Classifier: Programming Language :: Python :: 3
5
+ Classifier: Programming Language :: Rust
6
+ Classifier: Topic :: System :: Networking
7
+ Summary: DDS (Data Distribution Service) with its core in Rust: the Python binding
8
+ Home-Page: https://github.com/rustorb/rustorb-dds
9
+ License: MIT OR Apache-2.0
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
12
+ Project-URL: Homepage, https://github.com/rustorb/rustorb-dds
13
+
14
+ # rustorb-dds (Python)
15
+
16
+ The Python binding of [rustorb-dds](https://github.com/rustorb/rustorb-dds), a DDS (OMG Data Distribution Service) implementation with its core in Rust. It interoperates over RTPS 2.5 with other DDS implementations, such as Cyclone DDS, Fast DDS and ROS 2.
17
+
18
+ ```python
19
+ import rustorb_dds as dds
20
+
21
+ @dds.struct("HelloWorld::Greeting")
22
+ class Greeting:
23
+ index: dds.uint32
24
+ message: str
25
+
26
+ participant = dds.DomainParticipant(0)
27
+ topic = participant.create_topic("HelloWorldTopic", Greeting)
28
+
29
+ reader = participant.create_subscriber().create_datareader(topic, dds.Qos(reliability="reliable"))
30
+ writer = participant.create_publisher().create_datawriter(topic)
31
+ writer.wait_for_subscriptions(1, timeout=5.0)
32
+ writer.write(Greeting(1, "hello"))
33
+
34
+ if reader.wait_for_data(5.0):
35
+ for s in reader.take():
36
+ print(s.data, s.info.instance_state)
37
+ ```
38
+
39
+ ## Types
40
+
41
+ A topic's type is either:
42
+
43
+ - a class declared with `@dds.struct` / `@dds.union` (and `@dds.enum` on an `enum.IntEnum`, `@dds.bitmask` on an `enum.IntFlag` for its members), whose annotations are its members:
44
+
45
+ ```python
46
+ @dds.struct("Keyed::Shape", extensibility="appendable")
47
+ class Shape:
48
+ id: dds.key(dds.uint32)
49
+ color: dds.string(32)
50
+ points: dds.sequence(dds.int32, 10)
51
+ note: dds.optional(str)
52
+ ```
53
+
54
+ Member types are `bool`, `int` (int32), `float` (float64), `str`, `bytes`, the primitives `dds.int8` ... `dds.float128`, `dds.char8`, `dds.string(bound)`, `dds.wstring(bound)`, `dds.sequence(t, bound)`, `dds.array(t, *dims)`, `dds.map(k, v, bound)`, or another declared type. `dds.key`, `dds.optional` and `dds.member(t, id=, key=, optional=, must_understand=, external=, hash_id=)` give annotations; `dds.typedef(name, t)` is an IDL typedef. Member IDs are sequential from 0 unless given (or hashed with `autoid="hash"`).
55
+
56
+ [rustorb-idl](https://github.com/rustorb/rustorb-idl) writes these declarations from IDL: `rustorb-idl -bpython -Wbdds_only Foo.idl` writes `Foo_dds.py` (`from Foo_dds import MyModule`). Their TypeObjects are those other implementations make from the same IDL (checked against Cyclone DDS's idlc in `tests/test_generated.py`).
57
+
58
+ - or a `dds.DynamicType` (XTypes DynamicData), whose samples are plain values: dicts for structs, `(discriminator, value)` tuples for unions, lists, bytes, ints. `participant.discover_topic_type(name)` learns the type of a topic from the remote endpoints (with TypeLookup when they announce only its hash), so a program can read a topic without knowing its type beforehand.
59
+
60
+ The type of a declared class is described to the network as an XTypes TypeObject, so it matches the same type declared in IDL in other implementations.
61
+
62
+ ## Entities
63
+
64
+ `DomainParticipant(domain_id, localhost=False)`, `create_topic`, `create_publisher(partition=[...])`, `create_subscriber`, `create_datawriter(topic, qos, listener, mask)`, `create_datareader(...)`.
65
+
66
+ `DataWriter`: `write`, `register_instance`, `unregister_instance`, `dispose`, `lookup_instance`, `wait_for_acknowledgments`, `wait_for_subscriptions`, statuses, `status_condition`, `set_listener`.
67
+
68
+ `DataReader`: `take` / `read` (by state, or of an instance), `take_w_condition` / `read_w_condition`, `lookup_instance`, `get_key_value`, `wait_for_data`, `wait_for_publications`, statuses, `status_condition`, `create_readcondition`, `set_listener`.
69
+
70
+ `Qos` (reliability, history, durability, deadline, liveliness, data_representation, user_data, resource limits), `WaitSet`, `GuardCondition`, `StatusCondition`, `ReadCondition`, `StatusMask`, `DataWriterListener`, `DataReaderListener`. Listeners are called on the participant's threads.
71
+
72
+ ## Building
73
+
74
+ The native module is the `rustorb-dds-python` crate, built with [maturin](https://www.maturin.rs/):
75
+
76
+ ```sh
77
+ cd python
78
+ maturin develop # into the current virtualenv
79
+ pytest tests
80
+ ```
81
+
82
+ ## License
83
+
84
+ MIT OR Apache-2.0.
85
+
@@ -0,0 +1,71 @@
1
+ # rustorb-dds (Python)
2
+
3
+ The Python binding of [rustorb-dds](https://github.com/rustorb/rustorb-dds), a DDS (OMG Data Distribution Service) implementation with its core in Rust. It interoperates over RTPS 2.5 with other DDS implementations, such as Cyclone DDS, Fast DDS and ROS 2.
4
+
5
+ ```python
6
+ import rustorb_dds as dds
7
+
8
+ @dds.struct("HelloWorld::Greeting")
9
+ class Greeting:
10
+ index: dds.uint32
11
+ message: str
12
+
13
+ participant = dds.DomainParticipant(0)
14
+ topic = participant.create_topic("HelloWorldTopic", Greeting)
15
+
16
+ reader = participant.create_subscriber().create_datareader(topic, dds.Qos(reliability="reliable"))
17
+ writer = participant.create_publisher().create_datawriter(topic)
18
+ writer.wait_for_subscriptions(1, timeout=5.0)
19
+ writer.write(Greeting(1, "hello"))
20
+
21
+ if reader.wait_for_data(5.0):
22
+ for s in reader.take():
23
+ print(s.data, s.info.instance_state)
24
+ ```
25
+
26
+ ## Types
27
+
28
+ A topic's type is either:
29
+
30
+ - a class declared with `@dds.struct` / `@dds.union` (and `@dds.enum` on an `enum.IntEnum`, `@dds.bitmask` on an `enum.IntFlag` for its members), whose annotations are its members:
31
+
32
+ ```python
33
+ @dds.struct("Keyed::Shape", extensibility="appendable")
34
+ class Shape:
35
+ id: dds.key(dds.uint32)
36
+ color: dds.string(32)
37
+ points: dds.sequence(dds.int32, 10)
38
+ note: dds.optional(str)
39
+ ```
40
+
41
+ Member types are `bool`, `int` (int32), `float` (float64), `str`, `bytes`, the primitives `dds.int8` ... `dds.float128`, `dds.char8`, `dds.string(bound)`, `dds.wstring(bound)`, `dds.sequence(t, bound)`, `dds.array(t, *dims)`, `dds.map(k, v, bound)`, or another declared type. `dds.key`, `dds.optional` and `dds.member(t, id=, key=, optional=, must_understand=, external=, hash_id=)` give annotations; `dds.typedef(name, t)` is an IDL typedef. Member IDs are sequential from 0 unless given (or hashed with `autoid="hash"`).
42
+
43
+ [rustorb-idl](https://github.com/rustorb/rustorb-idl) writes these declarations from IDL: `rustorb-idl -bpython -Wbdds_only Foo.idl` writes `Foo_dds.py` (`from Foo_dds import MyModule`). Their TypeObjects are those other implementations make from the same IDL (checked against Cyclone DDS's idlc in `tests/test_generated.py`).
44
+
45
+ - or a `dds.DynamicType` (XTypes DynamicData), whose samples are plain values: dicts for structs, `(discriminator, value)` tuples for unions, lists, bytes, ints. `participant.discover_topic_type(name)` learns the type of a topic from the remote endpoints (with TypeLookup when they announce only its hash), so a program can read a topic without knowing its type beforehand.
46
+
47
+ The type of a declared class is described to the network as an XTypes TypeObject, so it matches the same type declared in IDL in other implementations.
48
+
49
+ ## Entities
50
+
51
+ `DomainParticipant(domain_id, localhost=False)`, `create_topic`, `create_publisher(partition=[...])`, `create_subscriber`, `create_datawriter(topic, qos, listener, mask)`, `create_datareader(...)`.
52
+
53
+ `DataWriter`: `write`, `register_instance`, `unregister_instance`, `dispose`, `lookup_instance`, `wait_for_acknowledgments`, `wait_for_subscriptions`, statuses, `status_condition`, `set_listener`.
54
+
55
+ `DataReader`: `take` / `read` (by state, or of an instance), `take_w_condition` / `read_w_condition`, `lookup_instance`, `get_key_value`, `wait_for_data`, `wait_for_publications`, statuses, `status_condition`, `create_readcondition`, `set_listener`.
56
+
57
+ `Qos` (reliability, history, durability, deadline, liveliness, data_representation, user_data, resource limits), `WaitSet`, `GuardCondition`, `StatusCondition`, `ReadCondition`, `StatusMask`, `DataWriterListener`, `DataReaderListener`. Listeners are called on the participant's threads.
58
+
59
+ ## Building
60
+
61
+ The native module is the `rustorb-dds-python` crate, built with [maturin](https://www.maturin.rs/):
62
+
63
+ ```sh
64
+ cd python
65
+ maturin develop # into the current virtualenv
66
+ pytest tests
67
+ ```
68
+
69
+ ## License
70
+
71
+ MIT OR Apache-2.0.
@@ -0,0 +1,23 @@
1
+ [package]
2
+ name = "rustorb-dds"
3
+ description = "DDS (Data Distribution Service) DCPS API in Rust"
4
+ version.workspace = true
5
+ edition.workspace = true
6
+ rust-version.workspace = true
7
+ license.workspace = true
8
+ repository.workspace = true
9
+ homepage.workspace = true
10
+ keywords.workspace = true
11
+ categories.workspace = true
12
+ publish = false
13
+
14
+ [dependencies]
15
+ rustorb-rtps.workspace = true
16
+ rustorb-xtypes.workspace = true
17
+ rustorb-typesupport.workspace = true
18
+
19
+ [dev-dependencies]
20
+ rustorb-typesupport.workspace = true
21
+
22
+ [lints]
23
+ workspace = true
@@ -0,0 +1,134 @@
1
+ //! DynamicData: a writer or a reader in a program that was not built with
2
+ //! the type of its topic. It gets the type from the other side's
3
+ //! endpoint, with the TypeLookup service, and writes or reads
4
+ //! [`DynamicData`] of it (rustorb-dds#34).
5
+ //!
6
+ //! ```text
7
+ //! dynamic pub <domain> <count> <appendable|mutable>
8
+ //! dynamic sub <domain> <count> <timeout_s> <appendable|mutable>
9
+ //! ```
10
+ //!
11
+ //! The peer is the `evolve` example, or `interop/cyclonedds/evolve.c`,
12
+ //! of either version: the topic is `evolve_appendable` or
13
+ //! `evolve_mutable`, RELIABLE and KEEP_ALL, in XCDR2. The publisher waits
14
+ //! for a reader, takes its type, and writes `count` samples (number 1,
15
+ //! 2, 3..., text "evolve <number>", and `extra` 100 + number when the
16
+ //! type has it). The subscriber takes the type of a writer and exits once
17
+ //! it has `count` samples with the expected number and text in order, or
18
+ //! with an error after `timeout_s` seconds or on a wrong sample.
19
+
20
+ use std::time::{Duration, Instant};
21
+
22
+ use rustorb_dds::{
23
+ DataReaderQos, DataWriterQos, DomainParticipant, DynamicData, DynamicDataFactory, History,
24
+ MEMBER_ID_INVALID, Reliability, data_representation,
25
+ };
26
+
27
+ fn main() -> Result<(), Box<dyn std::error::Error>> {
28
+ let args: Vec<String> = std::env::args().collect();
29
+ let usage = "usage: dynamic pub <domain> <count> <appendable|mutable>\n \
30
+ dynamic sub <domain> <count> <timeout_s> <appendable|mutable>";
31
+ if args.len() < 5 {
32
+ return Err(usage.into());
33
+ }
34
+ let sub = args[1] == "sub";
35
+ let kind = args.get(if sub { 5 } else { 4 }).ok_or(usage)?;
36
+ if kind != "appendable" && kind != "mutable" {
37
+ return Err(usage.into());
38
+ }
39
+ let topic_name = format!("evolve_{kind}");
40
+ let domain: u32 = args[2].parse()?;
41
+ let count: i32 = args[3].parse()?;
42
+ let participant = DomainParticipant::new(domain)?;
43
+ let wait = if sub {
44
+ Duration::from_secs(args[4].parse()?)
45
+ } else {
46
+ Duration::from_secs(60)
47
+ };
48
+ let deadline = Instant::now() + wait;
49
+ println!("rustorb-dds: waiting for the type of {topic_name}...");
50
+ let ty = participant
51
+ .discover_topic_type(&topic_name, wait)?
52
+ .ok_or("rustorb-dds: the type of the topic did not come")?;
53
+ println!(
54
+ "rustorb-dds: got type {} ({} members)",
55
+ ty.get_name(),
56
+ ty.get_member_count()
57
+ );
58
+ let topic = participant.create_dynamic_topic(&topic_name, &ty)?;
59
+ let id = |name: &str| {
60
+ ty.get_member_by_name(name)
61
+ .map(|m| m.get_id())
62
+ .unwrap_or(MEMBER_ID_INVALID)
63
+ };
64
+ let (number, text, extra) = (id("number"), id("text"), id("extra"));
65
+ if args[1] == "pub" {
66
+ let qos = DataWriterQos {
67
+ reliability: Reliability::reliable(),
68
+ history: History::KeepAll,
69
+ data_representation: vec![data_representation::XCDR2],
70
+ ..DataWriterQos::default()
71
+ };
72
+ let writer = participant
73
+ .create_publisher()?
74
+ .create_datawriter_with_qos(&topic, qos)?;
75
+ println!("rustorb-dds: waiting for a subscriber...");
76
+ while !writer.wait_for_subscriptions(1, Duration::from_secs(1)) {}
77
+ std::thread::sleep(Duration::from_millis(500));
78
+ for n in 1..=count {
79
+ let mut sample = DynamicDataFactory::create_data(&ty);
80
+ sample.set_int32_value(number, n)?;
81
+ sample.set_string_value(text, &format!("evolve {n}"))?;
82
+ if extra != MEMBER_ID_INVALID {
83
+ sample.set_int32_value(extra, 100 + n)?;
84
+ }
85
+ writer.write(&sample)?;
86
+ println!("rustorb-dds: sent {n}");
87
+ std::thread::sleep(Duration::from_millis(20));
88
+ }
89
+ writer.wait_for_acknowledgments(Duration::from_secs(30))?;
90
+ println!("rustorb-dds: all acknowledged");
91
+ } else {
92
+ let qos = DataReaderQos {
93
+ reliability: Reliability::reliable(),
94
+ history: History::KeepAll,
95
+ data_representation: vec![data_representation::XCDR2],
96
+ ..DataReaderQos::default()
97
+ };
98
+ let reader = participant
99
+ .create_subscriber()?
100
+ .create_datareader_with_qos(&topic, qos)?;
101
+ let mut got = 0;
102
+ while got < count {
103
+ if Instant::now() > deadline {
104
+ return Err(format!("rustorb-dds: got {got} of {count} samples").into());
105
+ }
106
+ let samples: Vec<DynamicData> =
107
+ reader.take().into_iter().filter_map(|s| s.data).collect();
108
+ if samples.is_empty() {
109
+ std::thread::sleep(Duration::from_millis(20));
110
+ }
111
+ for s in samples {
112
+ got += 1;
113
+ let want = format!("evolve {got}");
114
+ let (n, t) = (s.get_int32_value(number)?, s.get_string_value(text)?);
115
+ if n != got || t != want {
116
+ return Err(format!("got number {n} text {t:?}, want {got} {want:?}").into());
117
+ }
118
+ if extra != MEMBER_ID_INVALID {
119
+ println!(
120
+ "rustorb-dds: received {got} (extra {})",
121
+ s.get_int32_value(extra)?
122
+ );
123
+ } else {
124
+ println!("rustorb-dds: received {got}");
125
+ }
126
+ }
127
+ }
128
+ }
129
+ println!(
130
+ "rustorb-dds: {} TypeObjects came by TypeLookup",
131
+ participant.learnt_types()
132
+ );
133
+ Ok(())
134
+ }