92
92
//! Integers:
93
93
//!
94
94
//! - `{u,i}8` are serialized as a single byte
95
- //! - `{u,i}16/32/64` are serialized as bytes specified by the parser endianess type param.
96
- //! - `{u,i}128` is not supported.
95
+ //! - `{u,i}16/32/64/128` are serialized as bytes specified by the parser endianess type param.
96
+ //! - Custom {U,I}128/256 wrappers may be implemented later (similar to Borsh) for better support
97
+ //! in JS, debugging, logging, etc.
97
98
//!
98
99
//! Floats:
99
100
//!
@@ -272,6 +273,13 @@ impl<'a, W: Write, B: ByteOrder> serde::Serializer for &'a mut Serializer<W, B>
272
273
self . writer . write_i64 :: < B > ( v) . map_err ( SerializerError :: from)
273
274
}
274
275
276
+ #[ inline]
277
+ fn serialize_i128 ( self , v : i128 ) -> Result < Self :: Ok , Self :: Error > {
278
+ self . writer
279
+ . write_i128 :: < B > ( v)
280
+ . map_err ( SerializerError :: from)
281
+ }
282
+
275
283
#[ inline]
276
284
fn serialize_u8 ( self , v : u8 ) -> Result < Self :: Ok , Self :: Error > {
277
285
self . writer . write_all ( & [ v] ) . map_err ( SerializerError :: from)
@@ -292,6 +300,13 @@ impl<'a, W: Write, B: ByteOrder> serde::Serializer for &'a mut Serializer<W, B>
292
300
self . writer . write_u64 :: < B > ( v) . map_err ( SerializerError :: from)
293
301
}
294
302
303
+ #[ inline]
304
+ fn serialize_u128 ( self , v : u128 ) -> Result < Self :: Ok , Self :: Error > {
305
+ self . writer
306
+ . write_u128 :: < B > ( v)
307
+ . map_err ( SerializerError :: from)
308
+ }
309
+
295
310
#[ inline]
296
311
fn serialize_f32 ( self , _: f32 ) -> Result < Self :: Ok , Self :: Error > {
297
312
Err ( SerializerError :: Unsupported )
0 commit comments