# leveldb-rs-binding

[![CI](https://github.com/rim99/leveldb-rs-binding/actions/workflows/ci.yml/badge.svg)](https://github.com/rim99/leveldb-rs-binding/actions/workflows/ci.yml)

Rust interface for Google's LevelDB key-value storage library.

Documentation: https://docs.rs/leveldb-rs-binding/latest/leveldb/.

Refer to the CHANGELOG.md for release notes.

## Rust version policy

The `leveldb-rs-binding` is built and tested with stable releases of Rust toolchain.

Check [CI](https://github.com/rim99/leveldb-rs-binding/actions/workflows/ci.yml) for tested version.

## Dependencies

- LevelDB: `main` branch, commit id: ac69108
- Snappy: v1.2.2
- Zstd: v1.5.7

## Usage

If your project is using [Cargo](http://crates.io), drop the following lines in your `Cargo.toml`:

```text
[dependencies]
leveldb-rs-binding = "2.1"
```

## Development

Make sure you have all prerequisites installed, including `cmake`, `git` and a C++ compiler, like `g++` or `clang++`, that supports C++17.

Clone the repository, and run

```sh
$ cargo build
```

for building and

```sh
$ cargo test
```

to run the test suite.

## Examples

Check out the `example` directory.

## Benchmark

See [benchmarks/RESULT.md](benchmarks/RESULT.md) for performance comparison with C++ `db_bench`.

# License

MIT, see `LICENSE`
