Skip to main content

Module buffered_reader

Module buffered_reader 

Source
Expand description

File I/O buffered readers for AppendVec Specialized BufRead-like types for reading account data.

Callers can use these types to iterate efficiently over append vecs. They can do so by repeatedly calling:

  • fill_buf_required(account_meta_len) to scan the account metadata parts and determine the account data size,
  • optionally extend the obtained buffer to full account data using fill_buf_required(account_all_bytes_len)
  • consume(account_all_bytes_len) to move to the next account

When reading full accounts data whose sizes exceed the small stack buffer, the BufReaderWithOverflow should be used, which supports dynamically allocated buffer for preparing contiguous data slices.

Structs§

BufReaderWithOverflow
A buffered reader that wraps BufRead instance and implements RequiredLenBufRead.
BufferedReader
read a file a large buffer at a time and provide access to a slice in that buffer
SequentialFileReader
Reader for non-seekable files.
SequentialFileReaderBuilder
Utility for building SequentialFileReader with specified tuning options.

Traits§

FileBufRead
An extension of the BufRead trait for file readers that allow tracking file read position offset.
RequiredLenBufFileRead
RequiredLenBufRead
An extension of the BufRead trait for readers that require stronger control over returned buffer size.

Functions§

large_file_buf_reader
Open file at path with buffering reader using buf_size memory and doing read-ahead IO reads (if io_uring is supported by the platform)