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
parse::<LangSchema>(); parse::<UserSchema>();
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!
Hi, yeah.
I did read it once again today and I found out that I need to deserialize from owned value. Thanks for suggestion!: )
working example
Then compiler suggested to me a following syntax for where
statement:
where
for<'a> T: serde::Deserialize<'a>
And I'm like. What? That's exactly what I wanted to type - the lifetime for the for
clause.
Time to read more about trait bound (I guess that's how it's called).
Explanation in Nomicon
1 Like