k2hash_rust 1.0.2

Official k2hash Rust Driver
Documentation
  • Coverage
  • 81.65%
    89 out of 109 items documented7 out of 90 items with examples
  • Size
  • Source code size: 413.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 6.58 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hiwakaba

k2hash_rust

Overview

crates.io Documentation CI

k2hash_rust implements a k2hash client in Rust.

k2hash Rust

Install

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

Usage

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

Development

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

Documents

License

MIT License. See the LICENSE file.

AntPickax

AntPickax is