#io #stream #no-std

nightly no-std blocked-vec

A vector of byte blocks behaving like files

9 releases

0.1.8 Oct 4, 2022
0.1.7 Oct 4, 2022

#1917 in Data structures

MIT/Apache

46KB
1K SLoC

blocked-vec

A blocked vector, used like a File but is implemented purely in memory, supporting all vectorized operations. The APIs are pretty similar, like general std::io traits implementation, set_len (called resize here), append, and XX_at operations (like FileExt on *nix platforms).

Implementation

This structure is implemented as a vector of blocks, as the name implies. A block consists of an array of continuous memory pages, whose layout is either through querying the system or from the given parameter (new_paged, with_len_paged). This implementation is used to avoid frequent calls of reallocation methods when manipulating with massive data.

Dependencies

~175KB