An efficient key-value store for encoding documents.
KVDS is a format for encoding key-value lists where the key is a single u8
and the value is an array (called a Vec
in Rust) of u8
.
Vec<u8>
, and values are also Vec<u8>
, nesting is not hard to implement on a case-by-case basisThis crate, KVDS, is meant to be used as a Rust library. See the basic example for more information.
One of the most common types of data held in the value field is a string. In Rust, a Vec<u8>
can be converted to a String
as follows:
rust
String::from(std::str::from_utf8(&VEC_U8[..]).unwrap());
The String
can be converted back as follows:
rust
STRING.as_bytes().to_vec();
The process of saving to a file is currently pretty complicated. It is detailed in the files example.
Keys can only be one byte. There are therefore 256 distinct keys.
Values can be up to 18.4 exabytes. Needless to say, there are many, many unique combinations.
(AFAIK, 18.4 exabytes is also the theoretical limit for RAM in 64-bit CPUs).
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.