Iterators
preader has several iterator types, each for a different kind of file content:
| Iterator | Yields | Use When |
|---|---|---|
| Lines | UTF-8 strings | The file is text with newline-separated records |
| Bytes | Single bytes | You need byte-level control |
| Chunks | Byte slices | You want to process raw data in even blocks |
| Segments | Delimiter separated byte slices | The file uses a custom delimiter (e.g. CSV fields) |
All iterators share a common interface:
state/state()returns a snapshot of the current read position and file metadatapercent()returns progress through the file as a floating-point percentagesave()persists the current position to disk and returns the saved state
They differ in what they yield and which options they accept. Each page below covers one type with its options and examples in both Rust and Python