diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-08-08 22:32:02 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-08-08 22:33:36 +0100 |
| commit | 39e34d4f524f5492065ba47b6cd33d5f272cd515 (patch) | |
| tree | f16782a9292d9da9564e4ce7d5d6efb791ef0498 /examples/15-transient-0/output/rust/src | |
| parent | 6dd8f8fe274e11348b631abcf67ee7ccf8254997 (diff) | |
Partially support generic native types in java-transient-0
Diffstat (limited to 'examples/15-transient-0/output/rust/src')
| -rw-r--r-- | examples/15-transient-0/output/rust/src/data.rs | 7 | ||||
| -rw-r--r-- | examples/15-transient-0/output/rust/src/gen/data.rs | 5 | ||||
| -rw-r--r-- | examples/15-transient-0/output/rust/src/gen/data/transient_0.rs | 10 |
3 files changed, 22 insertions, 0 deletions
diff --git a/examples/15-transient-0/output/rust/src/data.rs b/examples/15-transient-0/output/rust/src/data.rs index 6078fd0..2cf748b 100644 --- a/examples/15-transient-0/output/rust/src/data.rs +++ b/examples/15-transient-0/output/rust/src/data.rs @@ -6,6 +6,13 @@ pub struct Native { pub b: i32, } +#[derive(Clone, Debug, Hash, PartialEq)] +pub struct GenericNative<A, B> { + pub a: A, + pub b: B, +} + + pub mod transient_0 { use ::std::any::Any; use ::std::sync::Arc; diff --git a/examples/15-transient-0/output/rust/src/gen/data.rs b/examples/15-transient-0/output/rust/src/gen/data.rs index 745bc9d..856d60f 100644 --- a/examples/15-transient-0/output/rust/src/gen/data.rs +++ b/examples/15-transient-0/output/rust/src/gen/data.rs @@ -122,6 +122,11 @@ pub struct StructWithNative { } #[derive(Clone, Debug, Hash, PartialEq)] +pub struct StructWithGenericNative { + pub a: crate::data::GenericNative::<::core::primitive::i32, ::std::string::String>, +} + +#[derive(Clone, Debug, Hash, PartialEq)] pub struct StructWithBox { pub inner: ::std::boxed::Box::<crate::data::StructWithInt32>, } diff --git a/examples/15-transient-0/output/rust/src/gen/data/transient_0.rs b/examples/15-transient-0/output/rust/src/gen/data/transient_0.rs index 5ef4811..c497b57 100644 --- a/examples/15-transient-0/output/rust/src/gen/data/transient_0.rs +++ b/examples/15-transient-0/output/rust/src/gen/data/transient_0.rs @@ -274,6 +274,16 @@ pub fn decode_struct_with_native(reader: &mut impl std::io::Read, shared_values: ::std::io::Result::Ok(crate::data::StructWithNative { a: a }) } +pub fn encode_struct_with_generic_native(value: &crate::data::StructWithGenericNative, writer: &mut impl std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> { + todo!(); + ::std::io::Result::Ok(()) +} + +pub fn decode_struct_with_generic_native(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::StructWithGenericNative> { + let a = todo!(); + ::std::io::Result::Ok(crate::data::StructWithGenericNative { a: a }) +} + 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(()) |
