redispatch

Crates.ioredispatch
lib.rsredispatch
version0.0.2
sourcesrc
created_at2023-05-09 11:45:57.289634
updated_at2023-05-09 14:54:15.259524
descriptionserialization and deserialization for redis
homepage
repositoryhttps://github.com/Kilerd/redispatch
max_upload_size
id860427
size3,357
Kilerd Chan (Kilerd)

documentation

README

redispatch

best serialization patch for redis

usage

add dependencies

# Cargo.toml
redis = { version = "0.23.0", features = ["aio", "tokio-comp"] }
redispatch = "0.0.1"

import redispatch::JsonSerdeCommands to use

use futures::prelude::*;
use redispatch::JsonSerdeCommands;
use serde::{Serialize, de::DeserializeOwned};

#[derive(Debug, DeserializeOwned)]
struct MyData {
    username: String
}

let client = redis::Client::open("redis://127.0.0.1/").unwrap();
let mut con = client.get_async_connection().await?;

let serde_ret = con.get::<MyData>("mydata").await?;

Commit count: 1

cargo fmt