dbus2 / zbus-old

Rust D-Bus crate.
https://gitlab.freedesktop.org/dbus/zbus
Other
49 stars 13 forks source link

Allow (de)serializing enums as strings #268

Closed zeenix closed 1 year ago

zeenix commented 2 years ago

(De)serialize enums as string if signature is "s".

zeenix commented 2 years ago

In GitLab by @Absolucy on Apr 1, 2022, 22:45

If anyone is wondering why: MPRIS2 uses string enums throughout the whole API.

zeenix commented 2 years ago

It actually is used by many. @fluke had a usecase for it too.

zeenix commented 2 years ago

In GitLab by @fluke on Apr 21, 2022, 06:08

Indeed. The systemd-logind has a few API that would translate very well to enum serde as strings.

zeenix commented 2 years ago

mentioned in commit 6518e472d8ea4d3dd20b194ccce9964f756f962e