Expand description
Iterating over a file by chunks, either starting at the end of the file with ReverseChunks
or at the end of piped stdin with LinesChunk or BytesChunk.
Use ReverseChunks::new to create a new iterator over chunks of bytes from the file.
Structs
- A
BytesChunkstoring a fixed size number of bytes in a buffer. - An abstraction layer on top of
BytesChunkmainly to simplify filling only the needed amount of chunks. See alsoSelf::fill. - Works similar to a
BytesChunkbut also stores the number of lines encountered in the current buffer. The size of the buffer is limited to a fixed size number of bytes. - An abstraction layer on top of
LinesChunkmainly to simplify filling only the needed amount of chunks. See alsoSelf::fill. Works similar likeBytesChunkBuffer, but works on top of lines delimited byself.delimiterinstead of bytes. - An iterator over a file in non-overlapping chunks from the end of the file.
Constants
- When reading files in reverse in
bounded_tail, this is the size of each block read at a time. - The size of the backing buffer of a LinesChunk or BytesChunk in bytes. The value of BUFFER_SIZE originates from the BUFSIZ constant in stdio.h and the libc crate to make stream IO efficient. In the latter the value is constantly set to 8192 on all platforms, where the value in stdio.h is determined on each platform differently. Since libc chose 8192 as a reasonable default the value here is set to this value, too.