summaryrefslogtreecommitdiff
path: root/examples/10-transient-0/output/rust/src/gen/data
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-07-18 19:20:10 +0100
committerMichael Williamson <mike@zwobble.org>2026-07-18 19:20:10 +0100
commit68b0b81149138dba9fb166c8574fc6d892215a81 (patch)
tree4660c1df63ea0aa00d15d01142066dbf6b561bc1 /examples/10-transient-0/output/rust/src/gen/data
parent9ebca11fc3d86ce4a5424e402503f5fbbc394468 (diff)
Support lists in rust-transient-0
Diffstat (limited to 'examples/10-transient-0/output/rust/src/gen/data')
-rw-r--r--examples/10-transient-0/output/rust/src/gen/data/transient_0.rs32
1 files changed, 28 insertions, 4 deletions
diff --git a/examples/10-transient-0/output/rust/src/gen/data/transient_0.rs b/examples/10-transient-0/output/rust/src/gen/data/transient_0.rs
index bfc7c75..f8e9be0 100644
--- a/examples/10-transient-0/output/rust/src/gen/data/transient_0.rs
+++ b/examples/10-transient-0/output/rust/src/gen/data/transient_0.rs
@@ -73,14 +73,38 @@ pub fn decode_inner_struct(reader: &mut impl std::io::Read) -> ::std::io::Result
}
pub fn encode_struct_with_list(value: &crate::data::StructWithList, writer: &mut impl std::io::Write) -> ::std::io::Result::<()> {
- todo!();
- todo!();
+ {
+ crate::transient_0::encode_int_64(&(((&value.a).len()).try_into()).unwrap(), writer)?;
+ };
+ for element in &value.a {
+ crate::transient_0::encode_int_64(element, writer)?;
+ };
+ {
+ crate::transient_0::encode_int_64(&(((&value.b).len()).try_into()).unwrap(), writer)?;
+ };
+ for element in &value.b {
+ crate::data::transient_0::encode_inner_struct(element, writer)?;
+ };
::std::io::Result::Ok(())
}
pub fn decode_struct_with_list(reader: &mut impl std::io::Read) -> ::std::io::Result::<crate::data::StructWithList> {
- let a = todo!();
- let b = todo!();
+ let a = {
+ let len = crate::transient_0::decode_int_64(reader)?;
+ let mut elements = ::std::vec::Vec::with_capacity((len.try_into()).unwrap());
+ for element_index in 0..len {
+ elements.push(crate::transient_0::decode_int_64(reader)?);
+ };
+ elements
+ };
+ let b = {
+ let len = crate::transient_0::decode_int_64(reader)?;
+ let mut elements = ::std::vec::Vec::with_capacity((len.try_into()).unwrap());
+ for element_index in 0..len {
+ elements.push(crate::data::transient_0::decode_inner_struct(reader)?);
+ };
+ elements
+ };
std::io::Result::Ok(crate::data::StructWithList { a: a, b: b })
}