ephemeropt

Crates.ioephemeropt
lib.rsephemeropt
version0.3.0
sourcesrc
created_at2023-08-09 21:04:41.260697
updated_at2024-01-06 03:29:49.625498
descriptionAn ephemeral Option that reverts to None after some time
homepage
repositoryhttps://github.com/ravenclaw900/ephemeropt
max_upload_size
id940381
size40,970
(ravenclaw900)

documentation

README

EphemerOpt

An ephemeral Option for Rust. When created, this EphemeralOption takes an expiry time and a value, and the EphemeralOption will revert to None after the time runs out.

This can be useful for possibly caching values instead of rerunning an expensive computation to get them. See the examples for a real-world demonstration of this using CPU data and message passing.

Commit count: 22

cargo fmt