mirror of
https://github.com/guilhermewerner/mini-redis
synced 2025-06-15 14:35:13 +00:00
20 lines
437 B
Rust
20 lines
437 B
Rust
#![allow(non_snake_case)]
|
|
|
|
use mini_redis::{client, Result};
|
|
|
|
#[tokio::main]
|
|
pub async fn main() -> Result<()> {
|
|
// Open a connection to the mini-redis address.
|
|
let mut client = client::connect("127.0.0.1:6379").await?;
|
|
|
|
// Set the key "hello" with value "world"
|
|
client.set("hello", "world".into()).await?;
|
|
|
|
// Get key "hello"
|
|
let result = client.get("hello").await?;
|
|
|
|
println!("{:?}", result);
|
|
|
|
Ok(())
|
|
}
|