I'm parsing some text and would like to store a Vec of slices of it.
struct Word<'a> {
word: &'a str,
// other_stuff
}
struct Text<'a> {
text: String,
words: Vec<Word<'a>>,
// other_things
}
I don't know how to say the lifetime of word
is the same as text
.
Is something like this possible?