structio 0.2.1
A read size that sizes the window, so a small document does not cost a 64 KiB buffer, and a hazard on read_seq written down.
[dependencies]
structio = "0.2"Changed
Documents::read_sizesizes the window as well as the read. The buffer is allocated on the first fill and holds one chunk, soDocuments::array(bytes).read_size(4096)costs 4 KiB rather than the 64 KiB it allocated up front before, whatever the read size said. That matters where streaming is not the point: a document already in memory can still be worth reading throughDocuments, which is what hands out the elements of a typed array one at a time with their headers installed, and there the default window was a thousand times the document. Applies to bothjson::Documentsandbeve::Documents;Feedis unchanged, having no chunk size to go by.beve::Reader::read_seqdocuments that element positions do not bound documents. A typed array's element headers, a complex array's, and a boolean run's are supplied by the reader rather than present in the input, so a span cut between twoposition()calls is not a valueReader::newcan read. A caller slicing spans out of a walk has to check the array's header type first;Documents::arrayis the way to take elements as documents of their own, and accepts every array shape.
No API was added, removed or changed. Nothing needs editing to move from 0.2.0.