rustorb 0.5.0__tar.gz → 0.6.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 (142) hide show
  1. {rustorb-0.5.0 → rustorb-0.6.0}/Cargo.lock +8 -8
  2. {rustorb-0.5.0 → rustorb-0.6.0}/Cargo.toml +6 -6
  3. {rustorb-0.5.0 → rustorb-0.6.0}/PKG-INFO +1 -1
  4. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/src/value.rs +6 -0
  5. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/lib.rs +1 -1
  6. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/object.rs +1 -0
  7. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/servant.rs +1 -0
  8. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/stream.rs +57 -0
  9. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/value.rs +38 -2
  10. {rustorb-0.5.0 → rustorb-0.6.0}/pyproject.toml +1 -1
  11. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/timeouts.py +2 -2
  12. {rustorb-0.5.0 → rustorb-0.6.0}/README.md +0 -0
  13. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/Cargo.toml +0 -0
  14. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/LICENSE-APACHE +0 -0
  15. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/LICENSE-MIT +0 -0
  16. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/README.md +0 -0
  17. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/src/decoder.rs +0 -0
  18. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/src/encoder.rs +0 -0
  19. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/src/error.rs +0 -0
  20. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/src/lib.rs +0 -0
  21. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/src/long_double.rs +0 -0
  22. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/src/octets.rs +0 -0
  23. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/src/traits.rs +0 -0
  24. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/src/xcdr.rs +0 -0
  25. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/tests/cdr.rs +0 -0
  26. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-cdr/tests/xcdr.rs +0 -0
  27. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/Cargo.toml +0 -0
  28. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/LICENSE-APACHE +0 -0
  29. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/LICENSE-MIT +0 -0
  30. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/README.md +0 -0
  31. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/benches/throughput.rs +0 -0
  32. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/codeset.rs +0 -0
  33. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/connection.rs +0 -0
  34. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/dii.rs +0 -0
  35. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/dynany/mod.rs +0 -0
  36. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/dynany/tests.rs +0 -0
  37. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/exception.rs +0 -0
  38. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/fixed.rs +0 -0
  39. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/idl/abstract_iface.rs +0 -0
  40. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/idl/mod.rs +0 -0
  41. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/idl/tests.rs +0 -0
  42. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/idl/value.rs +0 -0
  43. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/idle.rs +0 -0
  44. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/iop.rs +0 -0
  45. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/name.rs +0 -0
  46. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/orb.rs +0 -0
  47. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/pi.rs +0 -0
  48. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/poa.rs +0 -0
  49. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/policy.rs +0 -0
  50. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/pool.rs +0 -0
  51. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/server.rs +0 -0
  52. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/sock.rs +0 -0
  53. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/timeout.rs +0 -0
  54. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/tls.rs +0 -0
  55. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/trace.rs +0 -0
  56. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/typecode/cdr.rs +0 -0
  57. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/typecode/mod.rs +0 -0
  58. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/typecode/tests.rs +0 -0
  59. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/unix.rs +0 -0
  60. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/src/wire.rs +0 -0
  61. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/ami.rs +0 -0
  62. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/any.rs +0 -0
  63. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/async_api.rs +0 -0
  64. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/bidir.rs +0 -0
  65. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/client.rs +0 -0
  66. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/connections.rs +0 -0
  67. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/dii.rs +0 -0
  68. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/message_size.rs +0 -0
  69. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/pi.rs +0 -0
  70. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/poa.rs +0 -0
  71. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/poa_manager_factory.rs +0 -0
  72. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/policy.rs +0 -0
  73. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/server.rs +0 -0
  74. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/soak.rs +0 -0
  75. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/stress.rs +0 -0
  76. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/sync_scope.rs +0 -0
  77. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/ca.pem +0 -0
  78. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/client-bundle.pem +0 -0
  79. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/client.key +0 -0
  80. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/client.pem +0 -0
  81. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/make-certs.sh +0 -0
  82. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/other-ca.pem +0 -0
  83. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/other-server.key +0 -0
  84. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/other-server.pem +0 -0
  85. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/server-bundle.pem +0 -0
  86. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/server.key +0 -0
  87. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/server.pem +0 -0
  88. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/wrong-name.key +0 -0
  89. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls/wrong-name.pem +0 -0
  90. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/tls.rs +0 -0
  91. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/trace.rs +0 -0
  92. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/unix.rs +0 -0
  93. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-core/tests/valuetype.rs +0 -0
  94. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/Cargo.toml +0 -0
  95. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/LICENSE-APACHE +0 -0
  96. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/LICENSE-MIT +0 -0
  97. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/README.md +0 -0
  98. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/component.rs +0 -0
  99. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/corbaloc.rs +0 -0
  100. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/error.rs +0 -0
  101. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/fragment.rs +0 -0
  102. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/header.rs +0 -0
  103. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/iiop.rs +0 -0
  104. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/ior.rs +0 -0
  105. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/lib.rs +0 -0
  106. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/message.rs +0 -0
  107. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/service_context.rs +0 -0
  108. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/src/writer.rs +0 -0
  109. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/tests/giop.rs +0 -0
  110. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/tests/ior.rs +0 -0
  111. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-giop/tests/omniorb_golden.rs +0 -0
  112. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/Cargo.toml +0 -0
  113. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/LICENSE-APACHE +0 -0
  114. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/LICENSE-MIT +0 -0
  115. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/README.md +0 -0
  116. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/build.rs +0 -0
  117. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/any.rs +0 -0
  118. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/dii.rs +0 -0
  119. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/dynany.rs +0 -0
  120. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/error.rs +0 -0
  121. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/lib.rs +0 -0
  122. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/log.rs +0 -0
  123. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/orb.rs +0 -0
  124. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/pi.rs +0 -0
  125. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/poa.rs +0 -0
  126. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/tc.rs +0 -0
  127. {rustorb-0.5.0 → rustorb-0.6.0}/crates/rustorb-python/src/value.rs +0 -0
  128. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/BiDirPolicy.py +0 -0
  129. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/CORBA.py +0 -0
  130. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/DynamicAny.py +0 -0
  131. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/IOP.py +0 -0
  132. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/Messaging.py +0 -0
  133. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/Messaging__POA.py +0 -0
  134. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/PortableInterceptor.py +0 -0
  135. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/PortableServer.py +0 -0
  136. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/PortableServer__POA.py +0 -0
  137. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/TimeBase.py +0 -0
  138. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/__init__.py +0 -0
  139. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/_log.py +0 -0
  140. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/_native.pyi +0 -0
  141. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/_rt.py +0 -0
  142. {rustorb-0.5.0 → rustorb-0.6.0}/rustorb/_types.py +0 -0
@@ -438,11 +438,11 @@ dependencies = [
438
438
 
439
439
  [[package]]
440
440
  name = "rustorb-cdr"
441
- version = "0.5.0"
441
+ version = "0.6.0"
442
442
 
443
443
  [[package]]
444
444
  name = "rustorb-core"
445
- version = "0.5.0"
445
+ version = "0.6.0"
446
446
  dependencies = [
447
447
  "criterion",
448
448
  "libc",
@@ -457,7 +457,7 @@ dependencies = [
457
457
 
458
458
  [[package]]
459
459
  name = "rustorb-ffi"
460
- version = "0.5.0"
460
+ version = "0.6.0"
461
461
  dependencies = [
462
462
  "rustorb-cdr",
463
463
  "rustorb-core",
@@ -466,7 +466,7 @@ dependencies = [
466
466
 
467
467
  [[package]]
468
468
  name = "rustorb-giop"
469
- version = "0.5.0"
469
+ version = "0.6.0"
470
470
  dependencies = [
471
471
  "rustorb-cdr",
472
472
  "serde_json",
@@ -474,7 +474,7 @@ dependencies = [
474
474
 
475
475
  [[package]]
476
476
  name = "rustorb-interop"
477
- version = "0.5.0"
477
+ version = "0.6.0"
478
478
  dependencies = [
479
479
  "rustorb-core",
480
480
  "rustorb-naming",
@@ -491,14 +491,14 @@ dependencies = [
491
491
 
492
492
  [[package]]
493
493
  name = "rustorb-naming"
494
- version = "0.5.0"
494
+ version = "0.6.0"
495
495
  dependencies = [
496
496
  "rustorb-core",
497
497
  ]
498
498
 
499
499
  [[package]]
500
500
  name = "rustorb-python"
501
- version = "0.5.0"
501
+ version = "0.6.0"
502
502
  dependencies = [
503
503
  "pyo3",
504
504
  "pyo3-build-config",
@@ -508,7 +508,7 @@ dependencies = [
508
508
 
509
509
  [[package]]
510
510
  name = "rustorb-typesupport"
511
- version = "0.5.0"
511
+ version = "0.6.0"
512
512
  dependencies = [
513
513
  "rustorb-cdr",
514
514
  ]
@@ -3,7 +3,7 @@ resolver = "3"
3
3
  members = ["crates/rustorb-cdr", "crates/rustorb-giop", "crates/rustorb-core", "crates/rustorb-python"]
4
4
 
5
5
  [workspace.package]
6
- version = "0.5.0"
6
+ version = "0.6.0"
7
7
  edition = "2024"
8
8
  rust-version = "1.85"
9
9
  license = "MIT OR Apache-2.0"
@@ -13,11 +13,11 @@ keywords = ["corba", "giop", "iiop", "orb", "rpc"]
13
13
  categories = ["network-programming"]
14
14
 
15
15
  [workspace.dependencies]
16
- rustorb-cdr = { path = "crates/rustorb-cdr", version = "0.5.0" }
17
- rustorb-typesupport = { path = "crates/rustorb-typesupport", version = "0.5.0" }
18
- rustorb-giop = { path = "crates/rustorb-giop", version = "0.5.0" }
19
- rustorb-core = { path = "crates/rustorb-core", version = "0.5.0" }
20
- rustorb-naming = { path = "crates/rustorb-naming", version = "0.5.0" }
16
+ rustorb-cdr = { path = "crates/rustorb-cdr", version = "0.6.0" }
17
+ rustorb-typesupport = { path = "crates/rustorb-typesupport", version = "0.6.0" }
18
+ rustorb-giop = { path = "crates/rustorb-giop", version = "0.6.0" }
19
+ rustorb-core = { path = "crates/rustorb-core", version = "0.6.0" }
20
+ rustorb-naming = { path = "crates/rustorb-naming", version = "0.6.0" }
21
21
  tokio = { version = "1", default-features = false }
22
22
 
23
23
  [workspace.lints.rust]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rustorb
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Topic :: System :: Networking
6
6
  Classifier: Topic :: Software Development :: Object Brokering
@@ -84,6 +84,12 @@ struct Frame {
84
84
  }
85
85
 
86
86
  impl Encoder {
87
+ /// The number of values written so far (not counting indirections):
88
+ /// the slot a reader gives the next new value.
89
+ pub fn value_count(&self) -> usize {
90
+ self.values.as_ref().map_or(0, |s| s.written.len())
91
+ }
92
+
87
93
  /// Writes a `null` value.
88
94
  pub fn write_null_value(&mut self) {
89
95
  self.write_u32(0);
@@ -110,7 +110,7 @@ pub use stream::{InStream, OutStream};
110
110
  pub use timeout::{set_thread_call_timeout, thread_call_timeout};
111
111
  pub use typecode::{TCKind, TypeCode, TypeCodeError};
112
112
  pub use value::{
113
- Any, CustomReader, Native, Value, ValueRef, ValueTypeResolver, lookup_value_type,
113
+ Any, CustomReader, Native, Value, ValueRef, ValueTypeResolver, WeakValueRef, lookup_value_type,
114
114
  register_custom_reader, register_value_type, set_value_type_resolver, unregister_custom_reader,
115
115
  unregister_value_type,
116
116
  };
@@ -1670,6 +1670,7 @@ fn encode_request<A: WriteArgs + ?Sized>(
1670
1670
  enc: m.body(),
1671
1671
  code_sets,
1672
1672
  orb: None,
1673
+ values: None,
1673
1674
  };
1674
1675
  args.write_args(&mut out)?;
1675
1676
  }
@@ -231,6 +231,7 @@ impl ServerReply {
231
231
  enc: self.msg.body(),
232
232
  code_sets: self.code_sets,
233
233
  orb: None,
234
+ values: None,
234
235
  }
235
236
  }
236
237
 
@@ -21,6 +21,19 @@ pub struct OutStream<'a> {
21
21
  /// The ORB of the first object reference written, so that a standalone
22
22
  /// stream can be read back with it (`Any::insert`).
23
23
  pub(crate) orb: Option<Orb>,
24
+ /// What a binding asked to know of the valuetypes written
25
+ /// ([`OutStream::log_values`]).
26
+ pub(crate) values: Option<ValueLog>,
27
+ }
28
+
29
+ /// The valuetypes written to an [`OutStream`] that logs them.
30
+ #[derive(Debug, Default)]
31
+ pub(crate) struct ValueLog {
32
+ /// Whether every value is written chunked.
33
+ pub(crate) chunked: bool,
34
+ /// The instances written (not as indirections), in order: the n-th is
35
+ /// read back at slot n.
36
+ pub(crate) written: Vec<crate::ValueRef>,
24
37
  }
25
38
 
26
39
  impl<'a> OutStream<'a> {
@@ -32,6 +45,34 @@ impl<'a> OutStream<'a> {
32
45
  enc,
33
46
  code_sets: CodeSets::NATIVE,
34
47
  orb: None,
48
+ values: None,
49
+ }
50
+ }
51
+
52
+ /// Makes the stream keep the valuetype instances it writes, for
53
+ /// [`OutStream::written_values`], and write each value chunked (so
54
+ /// that a reader can skip one whole, nested values included). A
55
+ /// binding uses it to find the instance a value read back stands for.
56
+ pub fn log_values(&mut self) {
57
+ self.values = Some(ValueLog {
58
+ chunked: true,
59
+ written: Vec::new(),
60
+ });
61
+ }
62
+
63
+ /// The instances written since [`OutStream::log_values`] (not those
64
+ /// written as indirections), in order: the reader of the stream reads
65
+ /// the n-th at slot n.
66
+ pub fn written_values(&mut self) -> Vec<crate::ValueRef> {
67
+ self.values
68
+ .as_mut()
69
+ .map(|l| std::mem::take(&mut l.written))
70
+ .unwrap_or_default()
71
+ }
72
+
73
+ pub(crate) fn note_value(&mut self, v: &crate::ValueRef) {
74
+ if let Some(log) = &mut self.values {
75
+ log.written.push(v.clone());
35
76
  }
36
77
  }
37
78
 
@@ -253,6 +294,22 @@ impl<'a> InStream<'a> {
253
294
  }
254
295
  }
255
296
 
297
+ /// Makes the value read at `slot` (the n-th value of the stream) be
298
+ /// read into `v`, replacing its state, if it has the type of `v`;
299
+ /// otherwise a new instance is made as usual. A binding uses it to
300
+ /// keep the instance a value it wrote already stands for.
301
+ pub fn preset_value(&mut self, slot: usize, v: crate::ValueRef) {
302
+ if self.values.len() <= slot {
303
+ self.values.resize(slot + 1, None);
304
+ }
305
+ self.values[slot] = Some(v);
306
+ }
307
+
308
+ /// The instance read at `slot`, if any.
309
+ pub fn value_at(&self, slot: usize) -> Option<&crate::ValueRef> {
310
+ self.values.get(slot).and_then(Option::as_ref)
311
+ }
312
+
256
313
  /// The rest of the stream, owned, if it reads a message body and no
257
314
  /// valuetype has been read (later ones could refer to it).
258
315
  pub(crate) fn detach(&self) -> Option<DetachedInput> {
@@ -281,6 +281,29 @@ fn each_ref(v: &Value, f: &mut impl FnMut(&ValueRef)) {
281
281
  }
282
282
  }
283
283
 
284
+ /// A [`ValueRef`] that does not keep the instance alive (see
285
+ /// [`ValueRef::downgrade`]).
286
+ #[derive(Clone)]
287
+ pub struct WeakValueRef(std::sync::Weak<ValueObj>);
288
+
289
+ impl WeakValueRef {
290
+ /// The instance, if it is still alive.
291
+ pub fn upgrade(&self) -> Option<ValueRef> {
292
+ self.0.upgrade().map(ValueRef)
293
+ }
294
+
295
+ /// Whether the instance has been dropped (or is being dropped).
296
+ pub fn is_dead(&self) -> bool {
297
+ self.0.strong_count() == 0
298
+ }
299
+ }
300
+
301
+ impl std::fmt::Debug for WeakValueRef {
302
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
303
+ f.write_str("WeakValueRef")
304
+ }
305
+ }
306
+
284
307
  /// An instance of a valuetype or a value box: its type and its state.
285
308
  ///
286
309
  /// Clones share the instance, as references do in the language
@@ -364,6 +387,11 @@ impl ValueRef {
364
387
  Arc::as_ptr(&self.0) as usize as u64
365
388
  }
366
389
 
390
+ /// A reference that does not keep the instance alive.
391
+ pub fn downgrade(&self) -> WeakValueRef {
392
+ WeakValueRef(Arc::downgrade(&self.0))
393
+ }
394
+
367
395
  fn lock(&self) -> MutexGuard<'_, Vec<Value>> {
368
396
  self.0.members.lock().unwrap_or_else(|e| e.into_inner())
369
397
  }
@@ -811,9 +839,11 @@ fn write_valuetype(
811
839
  let ids: Vec<&str> = ids.iter().map(String::as_str).collect();
812
840
  // A value of a truncatable type is chunked, so that a receiver can
813
841
  // skip what it does not know.
814
- if !out.begin_value(v.key(), &ids, ids.len() > 1)? {
842
+ let chunked = ids.len() > 1 || out.values.as_ref().is_some_and(|l| l.chunked);
843
+ if !out.begin_value(v.key(), &ids, chunked)? {
815
844
  return Ok(());
816
845
  }
846
+ out.note_value(v);
817
847
  let types = state_types(&tc);
818
848
  let members = v.members();
819
849
  if members.len() != types.len() {
@@ -836,6 +866,7 @@ fn write_custom(
836
866
  if !out.begin_value(v.key(), &[tc.id().unwrap_or_default()], true)? {
837
867
  return Ok(());
838
868
  }
869
+ out.note_value(v);
839
870
  for item in v.members() {
840
871
  let Value::Any(item) = item else {
841
872
  return Err(bad_param());
@@ -1085,10 +1116,15 @@ impl Reader {
1085
1116
  Ok(VM_ABSTRACT) => return Err(input.marshal_error()),
1086
1117
  _ => None,
1087
1118
  };
1088
- let v = ValueRef::new(tc.clone(), Vec::new());
1089
1119
  if input.values.len() <= slot {
1090
1120
  input.values.resize(slot + 1, None);
1091
1121
  }
1122
+ // An instance set for this slot beforehand (`InStream::preset_value`)
1123
+ // is read into, if it has the type read.
1124
+ let v = match input.values[slot].take() {
1125
+ Some(r) if r.typecode().id().ok() == tc.id().ok() => r,
1126
+ _ => ValueRef::new(tc.clone(), Vec::new()),
1127
+ };
1092
1128
  input.values[slot] = Some(v.clone());
1093
1129
  if let Some(reader) = custom {
1094
1130
  reader(&v, input)?;
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "rustorb"
7
- version = "0.5.0"
7
+ version = "0.6.0"
8
8
  description = "CORBA ORB with its core in Rust: the Python binding"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT OR Apache-2.0" }
@@ -4,9 +4,9 @@ none).
4
4
  A call waits for its reply as long as the first of these that is set
5
5
  says:
6
6
 
7
- 1. the calling thread's timeout (:func:`set_thread_call_timeout`),
8
- 2. the object reference's (:func:`set_object_call_timeout`), shared by
7
+ 1. the object reference's (:func:`set_object_call_timeout`), shared by
9
8
  the references narrowed from it,
9
+ 2. the calling thread's timeout (:func:`set_thread_call_timeout`),
10
10
  3. the ORB's (:func:`set_call_timeout`, or ``-ORBclientCallTimeOutPeriod``).
11
11
 
12
12
  When the time is up, the call raises ``CORBA.TIMEOUT`` with
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes