diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-08-01 09:24:12 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-08-01 09:24:12 +0100 |
| commit | 6b4d2a11537282947dc71a646c168ea1343d6a52 (patch) | |
| tree | 091de7d0a71dda3779a13f14f221a0751552868e /examples/14-transient-0/output/rust/src/gen/data | |
| parent | 4524a8a16574887bfdb0ee66984709c8158470a6 (diff) | |
Support Box in transient-0
Diffstat (limited to 'examples/14-transient-0/output/rust/src/gen/data')
| -rw-r--r-- | examples/14-transient-0/output/rust/src/gen/data/transient_0.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/14-transient-0/output/rust/src/gen/data/transient_0.rs b/examples/14-transient-0/output/rust/src/gen/data/transient_0.rs index f2bf149..0c8efd3 100644 --- a/examples/14-transient-0/output/rust/src/gen/data/transient_0.rs +++ b/examples/14-transient-0/output/rust/src/gen/data/transient_0.rs @@ -264,6 +264,16 @@ pub fn decode_struct_with_sum(reader: &mut impl std::io::Read, shared_values: &m ::std::io::Result::Ok(crate::data::StructWithSum { inner: inner, b: b }) } +pub fn encode_struct_with_box(value: &crate::data::StructWithBox, writer: &mut impl std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> { + crate::data::transient_0::encode_struct_with_int_32((&value.inner).as_ref(), writer, shared_values)?; + ::std::io::Result::Ok(()) +} + +pub fn decode_struct_with_box(reader: &mut impl std::io::Read, shared_values: &mut ::std::vec::Vec::<::std::sync::Arc::<dyn ::std::any::Any + ::std::marker::Sync + ::std::marker::Send>>) -> ::std::io::Result::<crate::data::StructWithBox> { + let inner = ::std::boxed::Box::new(crate::data::transient_0::decode_struct_with_int_32(reader, shared_values)?); + ::std::io::Result::Ok(crate::data::StructWithBox { inner: inner }) +} + pub fn encode_struct_with_list_of_shared(value: &crate::data::StructWithListOfShared, writer: &mut impl std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> { { crate::transient_0::encode_int_64(&(((&value.inner).len()).try_into()).map_err(|error| ::std::io::Error::new(::std::io::ErrorKind::InvalidData, error))?, writer, shared_values)?; |
