tokio-valkey

Crates.iotokio-valkey
lib.rstokio-valkey
version
sourcesrc
created_at2024-11-26 18:44:00.238765
updated_at2024-12-04 05:31:31.295505
descriptionAn ergonomic, asynchronous Valkey driver
homepage
repository
max_upload_size
id1462144
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.

This project will include sync, async, and pooling. It is still 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