[][src]Module db::cache

Wrapper around redis server to easy manipulate cached data

Example

This example is not tested
use db::cache::Cache;
use redis::*;

let mut cache = Cache::new().expect("Can't connect to redis server");

// set key-value
let () = cache.conn.set("my_key", 42).unwrap();

// get key-value, key exists.
let value: Option<usize> = cache.conn.get("my_key").unwrap(); // Some(42)

// get key-value, key does not exist
let value: Option<usize> = cache.conn.get("other_key").unwrap(); // None

Structs

Cache

main wrapper around redis::Connection

Statics

REDIS_SERVER

default address for redis server