Endorphin
Key-Value based in-memory cache library which supports Custom Expiration Policies with standard HashMap, HashSet interface.
Example
use sleep;
use Duration;
use TTLPolicy;
use HashMap;
Currently, we are providing four pre-defined policies.
LazyFixedTTLPolicyuses Lazy Expiration as other cache crates do, it expires items when you access entry after its TTL.TTLPolicyuses Active Expiration which expires even you don't access to expired entries.TTIPolicyuses Active Expiration which expires even you don't access to expired entries.MixedPolicyis mixed policy of TTL and TTI