valkey

Crates.iovalkey
lib.rsvalkey
version
sourcesrc
created_at2024-11-26 18:02:46.754254
updated_at2024-12-06 07:44:41.48554
descriptionAn ergonomic, synchronous Valkey driver
homepage
repository
max_upload_size
id1462103
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Allan (allan2)

documentation

README

valkey-rs

Crates.io docs

A Valkey driver for Rust.

Compatibility with other key-value stores is not guaranteed.

This project will include sync, async, and pooling. It is currently incomplete and a work-in-progress.

Usage

Synchronous:

use std::net::{Ipv6Addr, SocketAddr};
use valkey::Client;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let addr = SocketAddr::from((Ipv6Addr::LOCALHOST, 6379));
    let mut client = Client::connect(addr)?;

    client.set("hello", "world")?;

    let value = client.get("hello")?.unwrap();
    println!("Hello {value}");

    Ok(())
}

Async:

use std::net::{Ipv6Addr, SocketAddr};
use tokio_valkey::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let addr = SocketAddr::from((Ipv6Addr::LOCALHOST, 6379));
    let mut client = Client::connect(addr).await?;

    client.set("hello", "world").await?;

    let value = client.get("hello").await?.unwrap();
    println!("Hello {value}");

    Ok(())
}

Crates

Use valkey for sync and tokio-valkey for async.

Commit count: 0

cargo fmt