38 releases (14 stable)

new 3.0.3 May 25, 2025
3.0.2 Nov 12, 2024
3.0.0 Sep 14, 2023
2.0.0 Jul 20, 2023
0.1.5 Oct 23, 2017

#337 in Database interfaces

Download history 493/week @ 2025-02-02 587/week @ 2025-02-09 356/week @ 2025-02-16 571/week @ 2025-02-23 279/week @ 2025-03-02 315/week @ 2025-03-09 387/week @ 2025-03-16 261/week @ 2025-03-23 146/week @ 2025-03-30 235/week @ 2025-04-06 202/week @ 2025-04-13 477/week @ 2025-04-20 262/week @ 2025-04-27 283/week @ 2025-05-04 308/week @ 2025-05-11 766/week @ 2025-05-18

1,651 downloads per month
Used in 9 crates (7 directly)

MIT license

430KB
11K SLoC

leveldb-rs

crates.io

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 fairly well. Please file an issue if you encounter problems.

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–11MB
~130K SLoC