Tokenizes all content and returns the result with statistics. This eagerly processes all lines and collects statistics.
(&self)
| 87 | /// |
| 88 | /// This eagerly processes all lines and collects statistics. |
| 89 | pub fn tokenize_all(&self) -> (Vec<TokenizedLine>, TokenStats) { |
| 90 | let mut lines = Vec::new(); |
| 91 | let mut stats = TokenStats::new(); |
| 92 | |
| 93 | for line in self.lines() { |
| 94 | stats.add_line(&line); |
| 95 | lines.push(line); |
| 96 | } |
| 97 | |
| 98 | (lines, stats) |
| 99 | } |
| 100 | |
| 101 | /// Checks if the content appears to be binary. |
| 102 | /// |