#![allow(clippy::disallowed_names)]
#![allow(clippy::let_underscore_future)]
use fred::{
cmd,
prelude::*,
types::{ClusterHash, CustomCommand},
};
use std::convert::TryInto;
#[tokio::main]
async fn main() -> Result<(), Error> {
let client = Builder::default_centralized().build()?;
client.init().await?;
let _: () = client.lpush("foo", vec![1, 2, 3]).await?;
let result: Vec<String> = client.custom(cmd!("LRANGE"), vec!["foo", "0", "3"]).await?;
println!("LRANGE Values: {:?}", result);
let _ = cmd!("LRANGE", blocking: false);
let _ = cmd!("LRANGE", hash: ClusterHash::FirstKey);
let _ = cmd!("LRANGE", hash: ClusterHash::FirstKey, blocking: false);
let command = CustomCommand::new("LRANGE", ClusterHash::FirstKey, false);
let _result: Vec<i64> = client
.custom_raw(command, vec!["foo", "0", "3"])
.await
.and_then(|frame| frame.try_into())
.and_then(|value: Value| value.convert())?;
Ok(())
}