Struct rust_cache::common::CacheEntry [] [src]

pub struct CacheEntry {
    pub string: String,
    pub expires: Tm,
}

This is a useful struct for use inside a cache implentation to keep track of the data and the expiration together. it can be converted to a form a string iteself for storage in any medium that accepts strings

Fields

string
expires

Methods

impl CacheEntry

fn new(string: String, ttl: Duration) -> Self

fn expired(&self) -> bool

Trait Implementations

impl ToString for CacheEntry

fn to_string(&self) -> String

impl FromStr for CacheEntry

type Err = ParseCacheEntryError

fn from_str(s: &str) -> Result<Self, Self::Err>

Derived Implementations

impl PartialEq for CacheEntry

fn eq(&self, __arg_0: &CacheEntry) -> bool

fn ne(&self, __arg_0: &CacheEntry) -> bool

impl Eq for CacheEntry

impl Debug for CacheEntry

fn fmt(&self, __arg_0: &mut Formatter) -> Result