[][src]Crate simple_lines

Simple and secure line iterators

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:

  • Implements std::iter::Iterator
  • 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 Err(Encoding)

Enums

Error

Result of calling ReadExt::lines_rc

Traits

ReadExt

Extensions to std::io::Read to implement simple and secure line iterators