diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-07-17 10:38:43 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-07-17 10:38:43 +0100 |
| commit | 59db18c7d8ea0fdce8ff25eef5a13e59e1af4c58 (patch) | |
| tree | 7cfc386f386103c63fa1ce7f589d204cd01f4c42 /examples/10-transient-0/output/rust/src/gen/transient_0.rs | |
| parent | d14b7d028aec3d491d9f162fc84aa8f4e51ec814 (diff) | |
Generate separate functions for primitive encode/decode
Diffstat (limited to 'examples/10-transient-0/output/rust/src/gen/transient_0.rs')
| -rw-r--r-- | examples/10-transient-0/output/rust/src/gen/transient_0.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/examples/10-transient-0/output/rust/src/gen/transient_0.rs b/examples/10-transient-0/output/rust/src/gen/transient_0.rs new file mode 100644 index 0000000..18a605c --- /dev/null +++ b/examples/10-transient-0/output/rust/src/gen/transient_0.rs @@ -0,0 +1,38 @@ +// Generated by hobgoblin. + +pub fn encode_bool(value: &::core::primitive::bool, writer: &mut impl std::io::Write) { + todo!(); +} + +pub fn decode_bool(reader: &mut impl std::io::Read) -> ::core::primitive::bool { + todo!() +} + +pub fn encode_int_32(value: &::core::primitive::i32, writer: &mut impl std::io::Write) { + writer.write_all(&value.to_le_bytes()); +} + +pub fn decode_int_32(reader: &mut impl std::io::Read) -> ::core::primitive::i32 { + let bytes = { + let mut bytes = [0; 4]; + reader.read_exact(&mut bytes); + bytes + }; + i32::from_le_bytes(bytes) +} + +pub fn encode_int_64(value: &::core::primitive::i64, writer: &mut impl std::io::Write) { + todo!(); +} + +pub fn decode_int_64(reader: &mut impl std::io::Read) -> ::core::primitive::i64 { + todo!() +} + +pub fn encode_string(value: &::std::string::String, writer: &mut impl std::io::Write) { + todo!(); +} + +pub fn decode_string(reader: &mut impl std::io::Read) -> ::std::string::String { + todo!() +} |
