#[cachekit]Expand description
Cache the result of an async function.
§Attributes
client = <ident>(required): Name of the&CacheKitparameter.ttl = <integer>(required): TTL in seconds.namespace = "<string>"(optional): Namespace prefix for the cache key.secure(optional flag): Use encrypted cache viacache.secure().
§Example
ⓘ
#[cachekit(client = cache, ttl = 60)]
async fn get_user(cache: &CacheKit, id: u64) -> Result<User, CachekitError> {
Ok(User { name: format!("User {id}") })
}