Crates.io | ephemeropt |
lib.rs | ephemeropt |
version | 0.3.0 |
source | src |
created_at | 2023-08-09 21:04:41.260697 |
updated_at | 2024-01-06 03:29:49.625498 |
description | An ephemeral Option that reverts to None after some time |
homepage | |
repository | https://github.com/ravenclaw900/ephemeropt |
max_upload_size | |
id | 940381 |
size | 40,970 |
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.