expiringmap 0.1.2

a HashMap-backed TTL map
Documentation
  • Coverage
  • 100%
    36 out of 36 items documented1 out of 36 items with examples
  • Size
  • Source code size: 14.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 523.25 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • randomairborne/expiringmap
    4 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • randomairborne

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());
}