[][src]Trait db::cache_structures::Cachable

pub trait Cachable {
    fn dump(&mut self) -> RedisResult<()>;
fn load(self) -> RedisResult<Self>
    where
        Self: Sized
;
fn destruct(self) -> RedisResult<()>;
fn uid(&self) -> UID;
fn name(&self) -> &str; fn make_key<'a>(&self, field_name: &'a str) -> String { ... }
fn create_tag<'a, T: ToRedisArgs + ToString>(
        &self,
        field_name: &'a str,
        field_value: &'a T
    ) -> (String, String) { ... } }

trait to all structures that are cachable to cache server

Required methods

fn dump(&mut self) -> RedisResult<()>

construct hmap of current object that inherits this trait

fn load(self) -> RedisResult<Self> where
    Self: Sized

decontructs data from caching server and updates internal fields must not lose track of UID

fn destruct(self) -> RedisResult<()>

Permentatly removes all data associated to this object from redis server

fn uid(&self) -> UID

retrieve UID for object

fn name(&self) -> &str

retrieve name of object

Loading content...

Provided methods

fn make_key<'a>(&self, field_name: &'a str) -> String

create key from struct name, uid, and custom identifier

fn create_tag<'a, T: ToRedisArgs + ToString>(
    &self,
    field_name: &'a str,
    field_value: &'a T
) -> (String, String)

Create tag for redis consumption in the format of (Name:uid:field, value)

Loading content...

Implementors

impl Cachable for CacheSocket[src]

Loading content...