rust-catalog
A "file-backed" map, which inserts keys and values into a file in O(n) time, and gets the values in O(log-n) time using binary search and file seeking. For now, it only supports (hashable) keys and values that implement the Display
and FromStr
traits (i.e., those which can be converted to string and parsed back from string). This will change to serialization in the near future.
See the module documentation for more information.
Usage
Note that this is still experimental, and so use it at your own risk!
Add the following to your Cargo.toml
...
= "0.1.1"
Have a look at the detailed example for the precise usage.
Checklist
- basic documentation and examples
- maintain the values in a separate data file (which eliminates the sparse file problem)
- serialize the values, so that all (serializable) types can be supported
- maintain an auxiliary index for speeding up the search
- merge the auxiliary index, data file and the main file (during
finish
) - add more methods required for maps (for now, it only supports
insert
andget
) - documentation of methods
- memory-mapped file?
- maintain a separate thread for file-writing, so that we don't block on insertion