Skip to main content

cache

Function cache 

Source
pub async fn cache<T, E, F, Fut>(
    key: &str,
    opts: CacheOptions,
    f: F,
) -> Result<T, E>
where T: Serialize + DeserializeOwned, F: FnOnce() -> Fut, Fut: Future<Output = Result<T, E>>,
Expand description

Memoize an async computation in the data cache. Memoize f in the global data cache.