Background
Configuration binding (e.g. Configuration::bind) calls through Deserialize::deserialize_in_place provided by the serde crate. The default implementation of Deserialize::deserialize_in_place simply calls Deserialize::deserialize and completely replaces the provided struct.
Goal
The ideal scenario would be to implement, or provide a callable implementation for, Deserialize::deserialize_in_place that a consumer can leverage. This would allow partially updating the supplied struct without requiring the presence of all configuration keys for each struct field.
It's not clear whether this is possible. The solution may require one or more macros.
Background
Configuration binding (e.g.
Configuration::bind) calls throughDeserialize::deserialize_in_placeprovided by theserdecrate. The default implementation ofDeserialize::deserialize_in_placesimply callsDeserialize::deserializeand completely replaces the provided struct.Goal
The ideal scenario would be to implement, or provide a callable implementation for,
Deserialize::deserialize_in_placethat a consumer can leverage. This would allow partially updating the supplied struct without requiring the presence of all configuration keys for each struct field.It's not clear whether this is possible. The solution may require one or more macros.