Help me with using Redis

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.

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(())
}

Thank you so much :smiley:

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.