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: 13.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.46 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • randomairborne/expiringmap
    3 1 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());
}