redisclient

Crates.ioredisclient
lib.rsredisclient
version0.1.2
sourcesrc
created_at2020-12-19 02:32:28.988414
updated_at2020-12-27 00:59:46.670175
descriptionRedis client for Rust
homepage
repositoryhttps://github.com/ltoddy/redis-rs
max_upload_size
id324498
size99,126
LiuTao (ltoddy)

documentation

README

redis-rs

ci

Redis client for Rust.

  • Pure Rust, and doesn't depend on any 3rd party libraries

Cargo.toml

[dependencies.redisclient]
version = "*"

src/main.rs

extern crate redisclient;

use redisclient::RedisResult;
use redisclient::RedisClient;

fn main() {
    if let Err(e) = run() {
        println!("Error -> {}", e);
    }
}

fn run() -> RedisResult<()> {
    let mut client = RedisClient::new()?;
    client.mset(vec![("key1", 1), ("key2", 2)])?;

    let values: Vec<String> = client.mget(vec!["key1", "key2"])?;
    println!("values -> {:?}", values);

    let values: Vec<isize> = client.mget(vec!["key1", "key2"])?;
    println!("values -> {:?}", values);

    Ok(())
}
Commit count: 92

cargo fmt