1 unstable release
0.1.0 | Jan 1, 2025 |
---|
#2147 in Rust patterns
160 downloads per month
Used in 2 crates
(via battler-wamp)
3KB
serde-struct-tuple-enum
serde-struct-tuple-enum is a utility crate, built initially for battler-wamp
. It provides procedural macros to automatically derive serde
's Serialize
and Deserialize
traits for enum types, where each variant of the enum if a struct that is encoded as a tuple of its fields (specifically using serde-struct-tuple
).
battler-wamp
uses this macro for all WAMP messages, since WAMP messages are encoded as a list, where the first element determines the message variant.
Dependencies
~0.7–1.3MB
~29K SLoC