Struct persistentcache::storage::redis::RedisStorage
[−]
[src]
pub struct RedisStorage { /* fields omitted */ }RedisStorage struct holds a redis::Connection variable.
Methods
impl RedisStorage[src]
pub fn new(host: &str) -> Result<Self, Error>[src]
Connects to the Redis server listening at host and constructs a new RedisStorage
struct.
This will fail in case there is no redis server running.
Examples
use persistentcache::storage::redis::RedisStorage; let s = RedisStorage::new("redis://127.0.0.1").unwrap();
Trait Implementations
impl PersistentCache for RedisStorage[src]
fn get(&self, name: &str) -> Result<Vec<u8>, Error>[src]
Returns the value within the Redis variable name.
fn set(&self, name: &str, val: &[u8]) -> Result<(), Error>[src]
Sets the Redis variable name to the array val of type &[u8].
fn flush(&self) -> Result<(), Error>[src]
Delete all variables stored in the Redis database which start with PREFIX_.