length(s) is cache_count(); s[[key]] is cache_get(), an error on a
miss; s[[key]] <- value is cache_set(); as.list(s) reads every value,
warning above 1000 entries and refusing above 100,000. names(), [ and
$ are not provided: listing is cache_keys(), and a subset of a cache is
not a cache.
Examples
s <- local_cache()
s[["a"]] <- 1
#> Error in cache_set(x, i, value): This cache has been closed.
s[["a"]]
#> Error in cache_get(x, i): This cache has been closed.
length(s)
#> Error in cache_count(x): This cache has been closed.
as.list(s)
#> Error in cache_keys(x): This cache has been closed.