why this is, and how to resolve this. and what is lifetime specifier.??
For references inside structs, you have to explicitely handle the lifetime of the reference.
See this chapter of the book for more explanations : https://doc.rust-lang.org/book/lifetimes.html#in-structs
For future reference, can you please copy the text and output into the question instead of pasting a picture? It’s much easier to read and copy to the playpen if someone wants to try to help. Just put ```rust on the line before and ``` on the line after for nice code formatting.
Also see this section