Struct binary_install::Cache

source ·
pub struct Cache {
    pub destination: PathBuf,
}
Expand description

Global cache for wasm-pack, currently containing binaries downloaded from urls like wasm-bindgen and such.

Fields§

§destination: PathBuf

Implementations§

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 to a directory with the version number 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.

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.

Downloads a tarball from the specified url, extracting it locally and returning the directory that the contents were extracted into.

Similar to download; use this function for languages that doesn’t emit a binary.

Downloads a tarball from the specified url, extracting it locally and returning the directory that the contents were extracted into.

Similar to download; use this function for languages that doesn’t emit a binary.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.