summaryrefslogtreecommitdiff
path: root/examples/11-transient-0/output/rust/src/gen
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-07-25 17:44:47 +0100
committerMichael Williamson <mike@zwobble.org>2026-07-25 17:44:47 +0100
commit5de41ad211a542ce1ae26a1db3f219b1aaf4c9f4 (patch)
treeb25f9f24d0ddb2517a8fe9dd923d0cb8b9e8efa6 /examples/11-transient-0/output/rust/src/gen
parentb219b7a24fbece0256b15d408e0f65d8136e671a (diff)
Test shared values of different types in java-transient-0
Diffstat (limited to 'examples/11-transient-0/output/rust/src/gen')
-rw-r--r--examples/11-transient-0/output/rust/src/gen/data.rs7
-rw-r--r--examples/11-transient-0/output/rust/src/gen/data/transient_0.rs14
2 files changed, 21 insertions, 0 deletions
diff --git a/examples/11-transient-0/output/rust/src/gen/data.rs b/examples/11-transient-0/output/rust/src/gen/data.rs
index d31f341..6703918 100644
--- a/examples/11-transient-0/output/rust/src/gen/data.rs
+++ b/examples/11-transient-0/output/rust/src/gen/data.rs
@@ -93,3 +93,10 @@ pub struct StructWithSum {
pub struct StructWithListOfShared {
pub inner: ::std::vec::Vec::<::std::sync::Arc::<crate::data::StructWithInt32>>,
}
+
+#[derive(Debug, PartialEq)]
+pub struct StructWithDifferentSharedTypes {
+ pub a: ::std::sync::Arc::<crate::data::StructWithInt32>,
+ pub b: ::std::sync::Arc::<crate::data::StructWithInt64>,
+ pub c: ::std::sync::Arc::<crate::data::StructWithInt32>,
+}
diff --git a/examples/11-transient-0/output/rust/src/gen/data/transient_0.rs b/examples/11-transient-0/output/rust/src/gen/data/transient_0.rs
index 442e723..fb07229 100644
--- a/examples/11-transient-0/output/rust/src/gen/data/transient_0.rs
+++ b/examples/11-transient-0/output/rust/src/gen/data/transient_0.rs
@@ -243,3 +243,17 @@ pub fn decode_struct_with_list_of_shared(reader: &mut impl std::io::Read) -> ::s
};
std::io::Result::Ok(crate::data::StructWithListOfShared { inner: inner })
}
+
+pub fn encode_struct_with_different_shared_types(value: &crate::data::StructWithDifferentSharedTypes, writer: &mut impl std::io::Write) -> ::std::io::Result::<()> {
+ crate::data::transient_0::encode_struct_with_int_32((&value.a).as_ref(), writer)?;
+ crate::data::transient_0::encode_struct_with_int_64((&value.b).as_ref(), writer)?;
+ crate::data::transient_0::encode_struct_with_int_32((&value.c).as_ref(), writer)?;
+ ::std::io::Result::Ok(())
+}
+
+pub fn decode_struct_with_different_shared_types(reader: &mut impl std::io::Read) -> ::std::io::Result::<crate::data::StructWithDifferentSharedTypes> {
+ let a = ::std::sync::Arc::new(crate::data::transient_0::decode_struct_with_int_32(reader)?);
+ let b = ::std::sync::Arc::new(crate::data::transient_0::decode_struct_with_int_64(reader)?);
+ let c = ::std::sync::Arc::new(crate::data::transient_0::decode_struct_with_int_32(reader)?);
+ std::io::Result::Ok(crate::data::StructWithDifferentSharedTypes { a: a, b: b, c: c })
+}