summaryrefslogtreecommitdiff
path: root/examples/16-transient-0/output/rust/src/gen/transient_0.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/16-transient-0/output/rust/src/gen/transient_0.rs')
-rw-r--r--examples/16-transient-0/output/rust/src/gen/transient_0.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/16-transient-0/output/rust/src/gen/transient_0.rs b/examples/16-transient-0/output/rust/src/gen/transient_0.rs
index b65ab95..f9538ca 100644
--- a/examples/16-transient-0/output/rust/src/gen/transient_0.rs
+++ b/examples/16-transient-0/output/rust/src/gen/transient_0.rs
@@ -4,7 +4,7 @@ pub type Encode<T, TWrite: ::std::io::Write> = fn(&T, &mut TWrite, &mut ::std::c
pub type Decode<TRead: ::std::io::Read, T> = fn(&mut TRead, &mut ::std::vec::Vec::<::std::sync::Arc::<dyn ::std::any::Any + ::std::marker::Sync + ::std::marker::Send>>) -> ::std::io::Result::<T>;
-pub fn encode_bool(value: &::core::primitive::bool, writer: &mut impl std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> {
+pub fn encode_bool(value: &::core::primitive::bool, writer: &mut impl ::std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> {
if *value {
writer.write_all(&1u8.to_le_bytes())?;
} else {
@@ -13,7 +13,7 @@ pub fn encode_bool(value: &::core::primitive::bool, writer: &mut impl std::io::W
::std::io::Result::Ok(())
}
-pub fn decode_bool(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::<::core::primitive::bool> {
+pub fn decode_bool(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::<::core::primitive::bool> {
let int_value = {
let bytes = {
let mut bytes = [0; 1];
@@ -29,12 +29,12 @@ pub fn decode_bool(reader: &mut impl std::io::Read, shared_values: &mut ::std::v
})
}
-pub fn encode_int_8(value: &::core::primitive::i8, writer: &mut impl std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> {
+pub fn encode_int_8(value: &::core::primitive::i8, writer: &mut impl ::std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> {
writer.write_all(&value.to_le_bytes())?;
::std::io::Result::Ok(())
}
-pub fn decode_int_8(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::<::core::primitive::i8> {
+pub fn decode_int_8(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::<::core::primitive::i8> {
let bytes = {
let mut bytes = [0; 1];
reader.read_exact(&mut bytes)?;
@@ -43,12 +43,12 @@ pub fn decode_int_8(reader: &mut impl std::io::Read, shared_values: &mut ::std::
::std::io::Result::Ok(::core::primitive::i8::from_le_bytes(bytes))
}
-pub fn encode_int_32(value: &::core::primitive::i32, writer: &mut impl std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> {
+pub fn encode_int_32(value: &::core::primitive::i32, writer: &mut impl ::std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> {
writer.write_all(&value.to_le_bytes())?;
::std::io::Result::Ok(())
}
-pub fn decode_int_32(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::<::core::primitive::i32> {
+pub fn decode_int_32(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::<::core::primitive::i32> {
let bytes = {
let mut bytes = [0; 4];
reader.read_exact(&mut bytes)?;
@@ -57,12 +57,12 @@ pub fn decode_int_32(reader: &mut impl std::io::Read, shared_values: &mut ::std:
::std::io::Result::Ok(::core::primitive::i32::from_le_bytes(bytes))
}
-pub fn encode_int_64(value: &::core::primitive::i64, writer: &mut impl std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> {
+pub fn encode_int_64(value: &::core::primitive::i64, writer: &mut impl ::std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> {
writer.write_all(&value.to_le_bytes())?;
::std::io::Result::Ok(())
}
-pub fn decode_int_64(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::<::core::primitive::i64> {
+pub fn decode_int_64(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::<::core::primitive::i64> {
let bytes = {
let mut bytes = [0; 8];
reader.read_exact(&mut bytes)?;
@@ -71,13 +71,13 @@ pub fn decode_int_64(reader: &mut impl std::io::Read, shared_values: &mut ::std:
::std::io::Result::Ok(::core::primitive::i64::from_le_bytes(bytes))
}
-pub fn encode_string(value: &::std::string::String, writer: &mut impl std::io::Write, shared_values: &mut ::std::collections::HashMap::<::core::primitive::usize, ::core::primitive::i64>) -> ::std::io::Result::<()> {
+pub fn encode_string(value: &::std::string::String, 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.len()).try_into()).map_err(|error| ::std::io::Error::new(::std::io::ErrorKind::InvalidData, error))?, writer, shared_values)?;
writer.write_all(value.as_bytes())?;
::std::io::Result::Ok(())
}
-pub fn decode_string(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::<::std::string::String> {
+pub fn decode_string(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::<::std::string::String> {
let len = crate::transient_0::decode_int_64(reader, shared_values)?;
let bytes = {
let mut bytes = vec![0u8; (len.try_into()).map_err(|error| ::std::io::Error::new(::std::io::ErrorKind::InvalidData, error))?];