35 releases (11 stable)

3.0.0 Sep 14, 2023
2.0.0 Jul 20, 2023
1.0.8 Jun 20, 2023
1.0.6 Jan 15, 2023
0.1.5 Oct 23, 2017

#556 in Database interfaces

Download history 190/week @ 2024-03-14 177/week @ 2024-03-21 329/week @ 2024-03-28 201/week @ 2024-04-04 135/week @ 2024-04-11 300/week @ 2024-04-18 181/week @ 2024-04-25 145/week @ 2024-05-02 134/week @ 2024-05-09 237/week @ 2024-05-16 210/week @ 2024-05-23 329/week @ 2024-05-30 308/week @ 2024-06-06 222/week @ 2024-06-13 279/week @ 2024-06-20 160/week @ 2024-06-27

1,014 downloads per month
Used in 10 crates (7 directly)

MIT license

425KB
10K 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–1.9MB
~29K SLoC