packtrack 3.0.1

A simple CLI for tracking mail packages
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::utils::UtcTime;
use chrono::{TimeDelta, Utc};
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct CacheEntry {
    pub text:    String,
    pub created: UtcTime,
}
impl CacheEntry {
    pub fn age(&self) -> TimeDelta {
        Utc::now() - self.created
    }
}