pub fn connect<T: ToSocketAddrs>(addr: T) -> Result<BlockingClient>
Expand description
Establish a connection with the Redis server located at addr
.
addr
may be any type that can be asynchronously converted to a
SocketAddr
. This includes SocketAddr
and strings. The ToSocketAddrs
trait is the Tokio version and not the std
version.
ยงExamples
use mini_redis::blocking_client;
fn main() {
let client = match blocking_client::connect("localhost:6379") {
Ok(client) => client,
Err(_) => panic!("failed to establish connection"),
};
}