Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rust wrapper for rocksdb

License

NotificationsYou must be signed in to change notification settings

rust-rocksdb/rust-rocksdb

Repository files navigation

RocksDB buildcrates.iodocumentationlicenseGitter chatrust 1.71.1 required

GitHub commits (since latest release)

Requirements

  • Clang and LLVM

Contributing

Feedback and pull requests are welcome! If a particular feature of RocksDB isimportant to you, please let me know by opening an issue, and I'llprioritize it.

Usage

This binding is statically linked with a specific version of RocksDB. If youwant to build it yourself, make sure you've also cloned the RocksDB andcompression submodules:

git submodule update --init --recursive

Compression Support

By default, support forSnappy,LZ4,Zstd,Zlib, andBzip2 compressionis enabled through crate features. If support for all of these compressionalgorithms is not needed, default features can be disabled and specificcompression algorithms can be enabled. For example, to enable only LZ4compression support, make these changes to your Cargo.toml:

[dependencies.rocksdb]default-features =falsefeatures = ["lz4"]

Multithreaded ColumnFamily alternation

RocksDB allows column families to be created and droppedfrom multiple threads concurrently, but this crate doesn't allow it by defaultfor compatibility. If you need to modify column families concurrently, enablethe crate featuremulti-threaded-cf, which makes this binding'sdata structures useRwLock by default. Alternatively, you can directly createDBWithThreadMode<MultiThreaded> without enabling the crate feature.

Switch between /MT or /MD run time library (Only for Windows)

The featuremt_static will request the library to be built with/MTflag, which results in library using the static version of the run-time library.This can be useful in case there's a conflict in the dependency tree between differentrun-time versions.

Switch between static and dynamic linking for bindgen (featuresbindgen-static andbindgen-runtime)

The featurebindgen-runtime will enable theruntime feature of bindgen, which dynamicallylinks to libclang. This is suitable for most platforms, and is enabled by default.

The featurebindgen-static will enable thestatic feature of bindgen, which staticallylinks to libclang. This is suitable for musllinux platforms, such as Alpine linux.To build on Alpine linux for example, make these changes to your Cargo.toml:

[dependencies.rocksdb]default-features =falsefeatures = ["bindgen-static","snappy","lz4","zstd","zlib","bzip2"]

Notice thatruntime andstatic features are mutually exclusive, and won't compile if both are enabled.

LTO

Enable thelto feature to enable link-time optimization. It will compile rocksdb with-flto flag. This feature is disabled by default.

Important

You must use clang asCC. Eg.CC=/usr/bin/clang CXX=/usr/bin/clang++. Clang llvm version must be the same as the one used by rust compiler.On the rust side you should useRUSTFLAGS="-Clinker-plugin-lto -Clinker=clang -Clink-arg=-fuse-ld=lld".

Check theRust documentation for more information.

About

rust wrapper for rocksdb

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp