collect all clients to one single folder (#119)

This commit is contained in:
Ting Sun
2023-04-14 18:47:10 +08:00
committed by GitHub
parent b1e365b62f
commit 79422c0714
11 changed files with 154 additions and 146 deletions

View File

@@ -13,12 +13,12 @@
#![warn(rust_2018_idioms)]
use mini_redis::{client, Result};
use mini_redis::{clients::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?;
let mut client = Client::connect("127.0.0.1:6379").await?;
// Set the key "hello" with value "world"
client.set("hello", "world".into()).await?;

View File

@@ -17,12 +17,12 @@
#![warn(rust_2018_idioms)]
use mini_redis::{client, Result};
use mini_redis::{clients::Client, Result};
#[tokio::main]
async fn main() -> Result<()> {
// Open a connection to the mini-redis address.
let mut client = client::connect("127.0.0.1:6379").await?;
let mut client = Client::connect("127.0.0.1:6379").await?;
// publish message `bar` on channel foo
client.publish("foo", "bar".into()).await?;

View File

@@ -17,12 +17,12 @@
#![warn(rust_2018_idioms)]
use mini_redis::{client, Result};
use mini_redis::{clients::Client, Result};
#[tokio::main]
pub async fn main() -> Result<()> {
// Open a connection to the mini-redis address.
let client = client::connect("127.0.0.1:6379").await?;
let client = Client::connect("127.0.0.1:6379").await?;
// subscribe to channel foo
let mut subscriber = client.subscribe(vec!["foo".into()]).await?;