Simple line iterator which prevents OutOfMemory if an attacker inputs very long sequences without a delimiter by applying a max_capacity.
The implementation reuses the last
std::rc::Rc<String> on calling next() if it isnt used anymore.
It currently uses the linebuffer library under the hood to provid a much simpler interface with fewer pitfalls:
- Incomplete lines result in
Err(Incomplete<Rc<String>>)to force users to think about this scenario
- Ok variant should be compatible with
std::io::BufReader(beside wrapping in Rc)
- Invalid UTF8 results in
Result of calling ReadExt::lines_rc
Extensions to std::io::Read to implement simple and secure line iterators