Crates.io | bvr-core |
lib.rs | bvr-core |
version | 0.0.4 |
source | src |
created_at | 2023-12-22 21:30:55.945855 |
updated_at | 2024-01-10 04:36:30.322425 |
description | The core components used for the bvr pager. |
homepage | |
repository | |
max_upload_size | |
id | 1078676 |
size | 82,431 |
This crate contains the core functionality of the BVR pager.
These buffers are used to store and interact with line-indexed data. The buffers can be created from files or streams.
Segment buffers are divided into segments. Segments are the smallest unit of data loaded into memory. They are currently configured to be 1MB in size.
Data from the segment buffers is accessed through the SegBytes
and SegStr
.
They borrow and pin the segment, preventing it from being unloaded from memory.
The LineIndex
is used to map between line numbers and byte offsets. It is primarily
used to answer questions like "what line is at this byte offset?" and "what byte
offset is at this line number?".
The LineMatches
is used to store matches in iteration order for a particular
regex upon a buffer. They can be composed into a single LineMatches
.