Description Usage Arguments Details Value See Also Examples
An backend definitions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | backend(name, reader, writer, ext, ...)
## S3 method for class 'backend'
print(x, ...)
backend_ext(backend = cache_backend())
as_backend(x, ...)
## S3 method for class 'character'
as_backend(x, ...)
## S3 method for class 'fs_ext'
as_backend(x, ...)
## S3 method for class 'fs_path'
as_backend(x, ...)
|
name |
string; name of backend. |
reader |
function for reading from the cache |
writer |
function for writing to the cache |
ext |
string extension associated with this file without the period. |
... |
other name-value pairs that are stored as part of the definitions |
backend |
string; name for backend |
A backend is the way cache reads and writes from the cache. This simply collects all the information associated with the backend in one list.
A backend for a cache contains complete details about storing and retrieving files
backend_ext()
gives the extensions associated with a backend.
as_backend
retrieves the backend based on x
. x
can be the name of the
backend, the extension associated with the backend or a file (with a known
extension). In every case, a backend object is returned.
list with subclass backend
A ext()
object for the backend
as_backends
returns a backend object based on x
:
character : backends named x
fs_ext : backend with x as its path extension
fs_path : backend that matches the same extension as the path
backends()
cache::cache_register()
cache_backend()
1 2 3 4 5 | backend( name="rds", reader=function() NULL, writer=function() NULL, ext="rds" )
'rds' %>% fs_ext() %>% as_backend() %>% .$name
'cache/iris.rds' %>% fs_path() %>% as_backend() %>% .$name
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.