[−][src]Struct binary_install::Cache
Global cache for wasm-pack, currently containing binaries downloaded from urls like wasm-bindgen and such.
Methods
impl Cache
[src]
pub fn new(name: &str) -> Result<Cache, Error>
[src]
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.
pub fn at(path: &Path) -> Cache
[src]
Creates a new cache specifically at a particular directory, useful in testing and such.
pub fn join(&self, path: &Path) -> PathBuf
[src]
Joins a path to the destination of this cache, returning the result
pub fn download(
&self,
install_permitted: bool,
name: &str,
binaries: &[&str],
url: &str
) -> Result<Option<Download>, Error>
[src]
&self,
install_permitted: bool,
name: &str,
binaries: &[&str],
url: &str
) -> Result<Option<Download>, 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.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,