Hey, this is more of a question than a ticket but I need to serialise some structs to have variable length number types in the generated binary. I see that serde_bare exposes a Uint
type, but I don't see an obvious way to use it.
Is this possible with serde_bare? If so, what am I missing?
Thanks!
Hi, sorry for not replying for this long.
The
Uint
type is meant to be used like any other integer type, likeu64
. You can embed it inside a struct, and then create a value for it withUint(value)
.
Can we implement
Deref
andFrom
forInt
andUInt
to easily convert between their inner types?
I'm happy to send some patches
#From seems good, but I'm not sure about Deref - see https://rust-lang.github.io/api-guidelines/predictability.html#c-deref
Tadeo
On Sun, Apr 21, 2024, at 12:10, ~chiefnoah wrote:
I'm happy to send some patches
-- View on the web: https://todo.sr.ht/~tdeo/serde_bare/6#event-346841
Oh, wasn't aware of the
Deref
recommendations. JustFrom
then.