From 5de41ad211a542ce1ae26a1db3f219b1aaf4c9f4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 25 Jul 2026 17:44:47 +0100 Subject: Test shared values of different types in java-transient-0 --- .../11-transient-0/output/rust/src/gen/data/transient_0.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'examples/11-transient-0/output/rust/src/gen/data') 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:: { + 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 }) +} -- cgit v1.2.3