MCPcopy Index your code
hub / github.com/dermesser/leveldb-rs

github.com/dermesser/leveldb-rs @v4.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.0.1 ↗ · + Follow
762 symbols 2,763 edges 48 files 198 documented · 26% updated 3mo ago★ 57921 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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.

Extension points exported contracts — how you extend this code

LdbIterator (Interface)
An extension of the standard `Iterator` trait that supports some methods necessary for LevelDB. This works because the i [9 …
src/types.rs
FilterPolicy (Interface)
Encapsulates a filter algorithm allowing to search for keys more efficiently. Usually, policies are used as a BoxedFilte [4 …
src/filter.rs
Compressor (Interface)
Custom compression method ``` # use rusty_leveldb::{Compressor, CompressorId}; #[derive(Debug, Clone, Copy, Default)] [4 …
src/compressor.rs
Cmp (Interface)
Comparator trait, supporting types that can be nested (i.e., add additional functionality on top of an inner comparator) [3 …
src/cmp.rs
RandomAccess (Interface)
(no doc) [4 implementers]
src/env.rs
ReceiverExt (Interface)
(no doc) [2 implementers]
src/asyncdb.rs
CompressorId (Interface)
Set default compressor id [2 implementers]
src/compressor.rs
Env (Interface)
(no doc) [2 implementers]
src/env.rs

Core symbols most depended-on inside this repo

len
called by 159
src/skipmap.rs
iter
called by 93
src/block.rs
internal_key
called by 55
src/key_types.rs
put
called by 49
src/db_impl.rs
err
called by 49
src/error.rs
insert
called by 47
src/skipmap.rs
cmp
called by 46
src/cmp.rs
for_test
called by 46
src/options.rs

Shape

Method 392
Function 275
Class 78
Enum 9
Interface 8

Languages

Rust100%

Modules by API surface

src/db_impl.rs63 symbols
src/version_set.rs54 symbols
src/version.rs48 symbols
src/mem_env.rs48 symbols
src/skipmap.rs36 symbols
src/table_reader.rs34 symbols
src/memtable.rs27 symbols
src/block.rs24 symbols
src/disk_env.rs23 symbols
src/merging_iter.rs22 symbols
src/cache.rs22 symbols
src/db_iter.rs21 symbols

For agents

$ claude mcp add leveldb-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact