Struct persistentcache::storage::redis::RedisStorage [−][src]
pub struct RedisStorage { /* fields omitted */ }
RedisStorage
struct holds a redis::Connection
variable.
Methods
impl RedisStorage
[src]
impl RedisStorage
pub fn new(host: &str) -> Result<Self, Error>
[src]
pub fn new(host: &str) -> Result<Self, Error>
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.
Example
use persistentcache::storage::redis::RedisStorage; let s = RedisStorage::new("redis://127.0.0.1").unwrap();
Trait Implementations
impl PersistentCache for RedisStorage
[src]
impl PersistentCache for RedisStorage
fn get(&mut self, name: &str) -> Result<Vec<u8>, Error>
[src]
fn get(&mut self, name: &str) -> Result<Vec<u8>, Error>
Returns the value within the Redis variable name
.
fn set(&mut self, name: &str, val: &[u8]) -> Result<(), Error>
[src]
fn set(&mut self, name: &str, val: &[u8]) -> Result<(), Error>
Sets the Redis variable name
to the array val
of type &[u8]
.
fn flush(&mut self) -> Result<(), Error>
[src]
fn flush(&mut self) -> Result<(), Error>
Delete all variables stored in the Redis database which start with PREFIX_
.
Auto Trait Implementations
impl Send for RedisStorage
impl Send for RedisStorage
impl !Sync for RedisStorage
impl !Sync for RedisStorage