rovkit 0.0.6

rust kit for my self
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[cfg(test)]
mod tests {
    use rovkit::cachekit::time_cache;
    use std::thread::sleep;
    use std::time::Duration;

    #[test]
    fn test_cache() {
        let mut cache = time_cache(2);
        cache.put("hello", "world");
        println!("{:?}", cache.get(&"hello")); // Some("world")

        sleep(Duration::from_secs(3));
        println!("{:?}", cache.get(&"hello")); // None,已超时
        assert_eq!(cache.get(&"hello"), None);
    }
}