Crates.io | blocked-vec |
lib.rs | blocked-vec |
version | 0.1.8 |
source | src |
created_at | 2022-10-03 11:01:52.60371 |
updated_at | 2022-10-04 05:41:40.772923 |
description | A vector of byte blocks behaving like files |
homepage | https://github.com/js2xxx/blocked-vec |
repository | https://github.com/js2xxx/blocked-vec |
max_upload_size | |
id | 678919 |
size | 45,493 |
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).
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.