You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: I'm working in a no-std embedded environment where I need to transfer serialized data over CAN bus, which only accept 8 bytes of data in its frames. Therefore, the 9 extra bytes in the json {"bits":3} is not something I can afford to transfer the bitflags 3, and I think bitflags would be a great way in this use case to allow transfering multiple flags with a very limited footprint on the wire.
The text was updated successfully, but these errors were encountered:
I’ve actually got a PR open right now in #297 that changes the default serialization format in 2.x to simply use the underlying integer type in non-human-readable formats.
The hashmap-y format originally used there was to maintain compatibility with what you’d get deriving serde traits in 1.x. I’ve moved that compatibility callout, just so users know their serialization data may change between those major versions.
Hi,
I'm having issues with the provided
Serialize
/Deserialize
implementations, which are currently raisingSerdeDeCustom
errors with postcard. Here is a minimal example to reproduce this:https://github.com/nim65s/debug-bitflags-serde-postcard/blob/main/src/postcard.rs
The same example with serde-json is fine, as it is with the tests in
src/external/serde_support.rs
, but postcard doesn't support the "hash-map"y interfaces of serde.So I'm wondering: what is the rationale for serializing
InternalBitFlags
as a struct withbits
and not directly as the numeric type ?Obviously, I can write my own
Serialize
/Deserialize
implementations foru8
s, but it would be way cleaner if this was provided by bitflags. Maybe we could provide both and let end users choose between the 2 ?Context: I'm working in a no-std embedded environment where I need to transfer serialized data over CAN bus, which only accept 8 bytes of data in its frames. Therefore, the 9 extra bytes in the json
{"bits":3}
is not something I can afford to transfer the bitflags3
, and I think bitflags would be a great way in this use case to allow transfering multiple flags with a very limited footprint on the wire.The text was updated successfully, but these errors were encountered: