31 releases (7 stable)

1.0.6 Jan 15, 2023
1.0.4 Aug 20, 2022
1.0.3 Jul 20, 2022
0.3.6 Jul 27, 2021
0.1.5 Oct 23, 2017

#180 in Database interfaces

Download history 224/week @ 2023-02-02 239/week @ 2023-02-09 307/week @ 2023-02-16 281/week @ 2023-02-23 260/week @ 2023-03-02 246/week @ 2023-03-09 205/week @ 2023-03-16 285/week @ 2023-03-23 201/week @ 2023-03-30 346/week @ 2023-04-06 293/week @ 2023-04-13 294/week @ 2023-04-20 304/week @ 2023-04-27 228/week @ 2023-05-04 175/week @ 2023-05-11 256/week @ 2023-05-18

993 downloads per month
Used in 10 crates (7 directly)

MIT license

420KB
10K SLoC

leveldb-rs

crates.io Travis CI

A fully compatible implementation of LevelDB in Rust. (any incompatibility is a bug!)

The implementation is very close to the original; often, you can see the same algorithm translated 1:1, and class (struct) and method names are similar or the same.

NOTE: I do not endorse using this library for any data that you care about. I do care, however, about bug reports.

Status

Working well, with a few rare bugs (see issues).

Goals

Some of the goals of this implementation are

  • As few copies of data as possible; most of the time, slices of bytes (&[u8]) are used. Owned memory is represented as Vec<u8> (and then possibly borrowed as slice). Zero-copy is not always possible, though, and sometimes simplicity is favored.
  • Correctness -- self-checking implementation, good test coverage, etc. Just like the original implementation.
  • Clarity; commented code, clear structure (hopefully doing a better job than the original implementation).
  • Coming close-ish to the original implementation; clarifying the translation of typical C++ constructs to Rust, and doing a better job at helping understand the internals.

Dependencies

~0.5–5.5MB
~81K SLoC