I've been trying to learn how to use the cmd function for rust & redis, what do I pass into "con: &mut redis::Connection" to be able to successfully call fn do_something?
pub fn do_something(con: &mut redis::Connection) -> redis::RedisResult<()>
{
let _ : () = redis::cmd("SET").arg("my_key").arg(42).query(con)?;
Ok(())
}
Thanks for all the future help.
alice
July 16, 2020, 8:14pm
2
fn main() -> redis::RedisResult<()> {
let client = redis::Client::open("redis://127.0.0.1/")?;
let mut con = client.get_connection()?;
do_something(&mut con)?;
Ok(())
}
system
Closed
October 14, 2020, 8:42pm
4
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.