Create Simple TCP Listener

This commit is contained in:
GuilhermeWerner
2021-01-19 12:12:09 -03:00
parent 1a7db6ba26
commit 3d6239e514
4 changed files with 71 additions and 0 deletions

17
Examples/Hello.rs Normal file
View File

@ -0,0 +1,17 @@
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(())
}