pub trait BufReadExt: BufRead {
// Provided method
fn lending_lines(&mut self) -> LendingLines<'_, Self>
where Self: Sized { ... }
}Expand description
Extension trait for std::io::BufRead.
Provided Methods§
Sourcefn lending_lines(&mut self) -> LendingLines<'_, Self>where
Self: Sized,
fn lending_lines(&mut self) -> LendingLines<'_, Self>where
Self: Sized,
Returns a lending iterator over the lines of this reader.
Unlike std::io::BufRead::lines, this iterator reuses a single String buffer
and yields lines as &str references bound to the lifetime of the iterator’s next call.
This avoids allocating a new string for every line.