| Crates.io | k2hash_rust |
| lib.rs | k2hash_rust |
| version | 1.0.2 |
| created_at | 2025-09-09 07:41:46.7459+00 |
| updated_at | 2025-09-12 01:40:32.84196+00 |
| description | Official k2hash Rust Driver |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1830370 |
| size | 414,301 |
k2hash_rust implements a k2hash client in Rust.

Firstly you must install the k2hash shared library.
curl -o- https://raw.github.com/yahoojapan/k2hash_rust/main/utils/libk2hash.sh | bash
You can install k2hash library step by step from source code. See Build for details.
Download the k2hash_rust package.
cd /path/to/your/rust/project
cargo add k2hash_rust
Here is a simple example of k2hash_rust that saves a key and get it.
use k2hash_rust::K2hash;
fn main() {
let db = K2hash::open_mem().expect("open_mem failed");
db.set("foo", "bar");
let v = db.get("foo");
println!("foo => {:?}", v);
}
Let's run eamples!
cargo run --example basic_usage
Here is the step to start developing k2hash_rust on Fedora42.
sudo dnf update -y
sudo dnf makecache && sudo yum install curl git -y && curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.rpm.sh | sudo bash
sudo dnf install libfullock-devel k2hash-devel -y
git clone https://github.com/yahoojapan/k2hash_rust.git
cd k2hash_rust
cargo build
cargo test
MIT License. See the LICENSE file.
AntPickax is