#[once]Expand description
Define a memoized function using a cache store that implements cached::Cached (and
cached::CachedAsync for async functions). Function arguments are not used to identify
a cached value, only one value is cached unless a time expiry is specified.
ยงAttributes
name: (optional, string) specify the name for the generated cache, defaults to the function name uppercase.time: (optional, u64) specify a cache TTL in seconds, implies the cache type is aTimedCachedorTimedSizedCache.sync_writes: (optional, bool) specify whether to synchronize the execution of writing of uncached values.result: (optional, bool) If your function returns aResult, only cacheOkvalues returned by the function.option: (optional, bool) If your function returns anOption, only cacheSomevalues returned by the function.with_cached_flag: (optional, bool) If your function returns acached::ReturnorResult<cached::Return, E>, thecached::Return.was_cachedflag will be updated when a cached value is returned.