Crate cached_fn

Crate cached_fn 

Source
Expand description

Cache a function’s result in a map.

§Example

let mut cached_sqr = cached(|x| x * x);
assert_eq!(cached_sqr(3), 9);

Functions§

cached
Transform a function by caching its result in a hashmap.
cached_ord
Transform a function by caching its result in a BTreeMap.