Function simple_redis::client::create[][src]

pub fn create(connection_string: &str) -> Result<Client, RedisError>
Expand description

Constructs a new redis client.
The redis connection string must be in the following format: redis://[:<passwd>@]<hostname>[:port][/<db>]

Arguments

  • connection_string - The connection string in the format of: redis://[:<passwd>@]<hostname>[:port][/<db>]

Example

extern crate simple_redis;
fn main() {
    match simple_redis::create("redis://127.0.0.1:6379/") {
        Ok(client) => println!("Created Redis Client"),
        Err(error) => println!("Unable to create Redis client: {}", error)
    }
}