Hello, today I had a rough fight with lifetimes. I lost
I have many JSON files/schemas to parse and I want to parse them using only one generic function using the following syntax
Here is the code to the playground with comments Link. I hope they will describe the problem correctly.
Do you have any advice for me? Or rather how many advices do you have
Thanks a lot for any help!
I did read it once again today and I found out that I need to deserialize from owned value. Thanks for suggestion!: )
Then compiler suggested to me a following syntax for
for<'a> T: serde::Deserialize<'a>
And I'm like. What? That's exactly what I wanted to type - the lifetime for the
Time to read more about trait bound (I guess that's how it's called).
Explanation in Nomicon