#can macro that takes json and deserializes it into struct without deserialize trait

9 messages · Page 1 of 1 (latest)

visual pecan
#

I have some structs that have not derived desalinize trait that i wan't to configure using json. I can't add that because its not in my crate. I also don't wan't to create bunch of wrappers for everything so my question is it possible to create some sort of macro for that or any other way that doesn't require lot of work

last locust
#

you can't implement a trait that isn't defined in your crate to a type that isn't defined in your crate. you can't avoid the wrappers.

#

if it makes sense to use these types with serde, you can try to add a derive of serde under a special feature to the crate in question, and open a PR,

visual pecan
#

i don't think it that needed for others so it wouldn't be considered

#

so if that's out of question then maybe there's some tool for auto generating wrappers?

last locust
graceful dove
visual pecan