I am trying to implement serde::Deserialize on an external type (which uses type params) using the newtype pattern. In the process I need to implement the visitor trait which has an associated type.
However I am getting unconstrained type parameter errors and I am unsure how to fix these in this case:
pub struct Money<'a, T: rusty_money::FormattableCurrency>(rusty_money::Money<'a, T>);
struct MoneyVisitor;
impl<'de, 'a, T> Visitor<'de> for MoneyVisitor { // unconstrained type parameter for 'a and T
type Value = Money<'a, T>;
//...
}
If I add type params to MoneyVisitor too I get errors about them being unused since it is an empty struct.