Crate k2hash_rust

Crate k2hash_rust 

Source
Expand description

k2hash_rust is a NoSQL Key Value Store(KVS) library developed by AntPickax, which is an open source team in LY Corporation and a product family of open source software developed by AntPickax.

§k2hash_rust

§Overview

k2hash_rust implements a k2hash client in 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);
}

§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

Structs§

BaseQueue
Base struct of Queue and KeyQueue struct.
K2hAttrPack
K2hAttrPack represents C-API’s K2HATTRPCK structure.
K2hKeyPack
K2hKeyPack represents C-API’s K2HKEYPCK structure.
K2hash
K2hash struct provides a high-level interface for interacting with the K2hash database.
K2hashKey
K2hashKey provides an iterator over the keys in the K2hash database.
KeyQueue
KeyQueue provides FIFO (first-in, first-out) functionality using k2hash database.
KeyQueueBuilder
KeyQueueBuilder provides a builder pattern for creating KeyQueue instances.
Queue
Queue provides FIFO (first-in, first-out) functionality using k2hash database.
QueueBuilder
QueueBuilder provides a builder pattern for creating Queue instances.

Enums§

DebugLevel
DebugLevel represents the level of detail in the debug output.
DumpLevel
DumpLevel represents the level of detail in the dump output.