collect all clients to one single folder (#119)
This commit is contained in:
@@ -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?;
|
||||
|
||||
@@ -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?;
|
||||
|
||||
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user