2023-06-01 21:47:38 +00:00
|
|
|
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-06-08 20:13:42 +00:00
|
|
|
let _ = con.set("/order/0", 0)?;
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-01 21:47:38 +00:00
|
|
|
/* do something here */
|
|
|
|
//let val : String = con.get("/pl/0/0")?;
|
2023-06-04 15:33:28 +00:00
|
|
|
let _ = con.set("/pl/0/0", "[(150.0, 230.0, 65280), \
|
|
|
|
(170.0, 170.0, 65280), \
|
|
|
|
(230.0, 170.0, 65280), \
|
|
|
|
(210.0, 230.0, 65280), \
|
|
|
|
(150.0, 230.0, 65280)]")?;
|
2023-06-08 20:13:42 +00:00
|
|
|
|
2023-06-01 21:47:38 +00:00
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2023-06-04 13:09:15 +00:00
|
|
|
_ = do_something();
|
2023-06-01 21:47:38 +00:00
|
|
|
}
|