summaryrefslogtreecommitdiff
path: root/examples/11-transient-0/output/rust/src/gen/data
diff options
context:
space:
mode:
Diffstat (limited to 'examples/11-transient-0/output/rust/src/gen/data')
-rw-r--r--examples/11-transient-0/output/rust/src/gen/data/transient_0.rs16
1 files changed, 14 insertions, 2 deletions
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 52ae7e1..b2f78c2 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
@@ -223,11 +223,23 @@ pub fn decode_struct_with_sum(reader: &mut impl std::io::Read) -> ::std::io::Res
}
pub fn encode_struct_with_shared(value: &crate::data::StructWithShared, writer: &mut impl std::io::Write) -> ::std::io::Result::<()> {
- crate::data::transient_0::encode_struct_with_int_32((&value.inner).as_ref(), writer)?;
+ {
+ crate::transient_0::encode_int_64(&(((&value.inner).len()).try_into()).map_err(|error| ::std::io::Error::new(::std::io::ErrorKind::InvalidData, error))?, writer)?;
+ for element in &value.inner {
+ crate::data::transient_0::encode_struct_with_int_32(element.as_ref(), writer)?;
+ };
+ };
::std::io::Result::Ok(())
}
pub fn decode_struct_with_shared(reader: &mut impl std::io::Read) -> ::std::io::Result::<crate::data::StructWithShared> {
- let inner = ::std::sync::Arc::new(crate::data::transient_0::decode_struct_with_int_32(reader)?);
+ let inner = {
+ let len = crate::transient_0::decode_int_64(reader)?;
+ let mut elements = ::std::vec::Vec::with_capacity((len.try_into()).map_err(|error| ::std::io::Error::new(::std::io::ErrorKind::InvalidData, error))?);
+ for _ in 0..len {
+ elements.push(::std::sync::Arc::new(crate::data::transient_0::decode_struct_with_int_32(reader)?));
+ };
+ elements
+ };
std::io::Result::Ok(crate::data::StructWithShared { inner: inner })
}