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 | bashYou 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_rustHere 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 -ysudo 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 testMIT License. See the LICENSE file.
AntPickax is
- an open source team in LY Corporation.
- a product family of open source software developed by AntPickax.
