https://github.com/nonnorm/ephemeropt
An Option that expires after a certain amount of time
https://github.com/nonnorm/ephemeropt
Last synced: 24 days ago
JSON representation
An Option that expires after a certain amount of time
- Host: GitHub
- URL: https://github.com/nonnorm/ephemeropt
- Owner: nonnorm
- License: apache-2.0
- Created: 2023-08-09T01:03:15.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-06T03:29:20.000Z (over 2 years ago)
- Last Synced: 2026-01-04T20:12:13.861Z (5 months ago)
- Language: Rust
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
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.