lj_rust/examples/populate_redis.rs

27 lines
583 B
Rust
Raw Permalink Normal View History

2023-07-17 20:44:06 +00:00
///
/// $ cargo run --example populate_redis
///
use redis::{
//RedisResult,
Client,
Commands,
Connection,
};
fn do_something() -> redis::RedisResult<()> {
let client = Client::open("redis://127.0.0.1/")?;
let mut con: Connection = client.get_connection()?;
2023-08-23 11:13:53 +00:00
let _ = con.set("/clientkey", "/pl/0/")?;
let _ = con.set(
"/EDH/0",
"[[1.0, 0.0, 0.0],\n [ 0.0, 1.0, 0.0],\n [ 0.0, 0.0, 1.0]]",
)?;
let _ = con.set("/kpps/0", "5000")?;
let _ = con.set("/intensity/0", "255")?;
2023-07-17 20:44:06 +00:00
Ok(())
}
fn main() {
_ = do_something();
}