1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
include!("./gen/data.rs");
#[derive(Clone, Debug, Hash, PartialEq)]
pub struct Native {
pub a: i32,
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;
use ::std::vec::Vec;
use super::Native;
include!("./gen/data/transient_0.rs");
pub fn encode_native(
value: &Native,
writer: &mut impl std::io::Write,
shared_values: &mut ::std::collections::HashMap::<usize, i64>,
) -> std::io::Result<()> {
crate::transient_0::encode_int_32(&value.a, writer, shared_values)?;
crate::transient_0::encode_int_32(&value.b, writer, shared_values)?;
Ok(())
}
pub fn decode_native(
reader: &mut impl std::io::Read,
shared_values: &mut Vec<Arc::<dyn Any + Sync + Send>>,
) -> std::io::Result<Native> {
let a = crate::transient_0::decode_int_32(reader, shared_values)?;
let b = crate::transient_0::decode_int_32(reader, shared_values)?;
Ok(Native { a, b })
}
}
|