How to mix serde with = and serde_as rules? / u128 as Hex
#507
-
|
I would like to chain something like serde Can I achieve something like this? Also, could there be a simple way to (de)serialize a number (in this case, an |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
I am unsure what exactly you think the In your case, your module will need to do everything, i.e., turn the |
Beta Was this translation helpful? Give feedback.
I am unsure what exactly you think the
u128_as_buffershould be doing. But I am not aware of any way of chaining multiple functions. Theserde_asmacro will also not let you useasandwithon the same field.In your case, your module will need to do everything, i.e., turn the
u128into a hex value and then instruct theSerializerhow to serialize it. Of course it is also possible to use theSerializeAstrait from this crate, i.e., you can make a type similar toHexwhich supportsu128.