Allow serializing/deserializing dict from/to structures with optional fields
Capturing an interesting idea from https://github.com/tmiasko/dbus-core/issues/1#issuecomment-660630492 discussion
The GetAll / GetConnectionCredentials example captures exactly aspect I tried to comment on. The implementation first extract properties into an intermediate representation HashMap<&str, Variant>, and then proceeds to extract individual properties out. The intermediate hash map is unfortunate. More importantly, example doesn't use serialize & deserialize impls derived through serde (is it possible to use those?):
#[derive(Deserialize) struct Credentials { process_id: Option<u32>, unix_user_id: Option<u32>, unix_group_ids: Option<Vec<u32>>, ... }
I like that idea. It has some drawbacks, such as the fact that you can't have unknown fields. But it is so common to use Dict with a strict set of items/strings that it makes more sense to me than going through HashMaps and allowing all keys. And it would really make manipulating the idiomatic a{sv} so much more convenient.
We should make it easy to do, +1