pub struct Cache { /* fields omitted */ }
Global cache for wasm-pack, currently containing binaries downloaded from
urls like wasm-bindgen and such.
Returns the global cache directory, as inferred from env vars and such.
This function may return an error if a cache directory cannot be
determined.
Creates a new cache specifically at a particular directory, useful in
testing and such.
Joins a path to the destination of this cache, returning the result
Downloads a tarball or zip file from the specified url, extracting it
locally and returning the directory that the contents were extracted
into.
Note that this function requries that the contents of url
never change
as the contents of the url are globally cached on the system and never
invalidated.
The name
is a human-readable name used to go into the folder name of
the destination, and binaries
is a list of binaries expected to be at
the url. If the URL's extraction doesn't contain all the binaries this
function will return an error.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static