Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 324 Bytes

README.md

File metadata and controls

15 lines (12 loc) · 324 Bytes

expiringmap

A rust library implementing a TTL map.

use std::time::Duration;
use expiringmap::ExpiringMap;

fn main() {
    let mut map = ExpiringMap::new();
    map.insert("key", "value", Duration::from_millis(50));
    std::thread::sleep(Duration::from_millis(60));
    assert!(map.get(&"key").is_none());
}