GAT Box lifetime problem
The Rust Programming Language Forum
GAT Box lifetime problem
Consider the trait below. A Parser is a type which can take an input string and turn it into a bunch of candidate result. Each candidate stores: (1) the byte index up until which the result was found, and (2) a number of substrings that have been captured. pub trait Parser { type Iter<'txt> : Iterator<Item = (usize, Vec<&'txt str>)>; fn parse<'me, 'txt>(&'me self, input : &'txt str) -> Self::Iter<'txt>; } It is important that a parser's result is liftetime-independent of its output: a ...
0 comments
No comments yet.