Conflicting `DeserializeSeed` impls for different deserializable types with the same seed type
Consider this struct:
struct B {
c: ComplicatedType,
}
We have that ComplicatedType has a DeserializableSeed implementation for a seed of type &Seed. Therefore, struct B should have a DeserializableSeed implementation for a seed of type &Seed. However, when I try to do so:
impl<'de> DeserializeSeed<'de> for &SeedT {
type Value = ComplicatedType;
…
}
impl<'de> DeserializeSeed<'de> for &SeedT {
type Value = B;
…
}
this is an error because we are impling the same trait for the same seed twice. What's a good way to go about this?
More generally, is it possible to automatically derive (or minimize boilerplate for) DeserializeSeed for some type T wrt. a particular seed S when all of the inner types of T are already either Deserialize or DeserializeSeed wrt. S?
You might be interested in https://docs.rs/serde-seeded/latest/serde_seeded and https://docs.rs/serde_state/latest/serde_state which try to do this.