[][src]Trait shared_expiry_get::Expiry

pub trait Expiry {
    fn valid(&self) -> bool;
}

Used to determine whether the remote data is still valid.

Required methods

fn valid(&self) -> bool[src]

Return whether the remote data is still valid.

Example:


#[derive(Clone)]
struct E {
    expire: DateTime<Utc>,
    payload: String,
}
impl Expiry for E {
    fn valid(&self) -> bool {
        self.expire > Utc::now()
    }
}
Loading content...

Implementors

Loading content...