Struct proto_deno::DenoLanguage
source · pub struct DenoLanguage {
pub base_dir: PathBuf,
pub bin_path: Option<PathBuf>,
pub log_target: String,
pub temp_dir: PathBuf,
pub version: Option<String>,
}Fields§
§base_dir: PathBuf§bin_path: Option<PathBuf>§log_target: String§temp_dir: PathBuf§version: Option<String>Implementations§
Trait Implementations§
source§impl Debug for DenoLanguage
impl Debug for DenoLanguage
source§impl Describable<'_> for DenoLanguage
impl Describable<'_> for DenoLanguage
source§impl Detector<'_> for DenoLanguage
impl Detector<'_> for DenoLanguage
source§fn detect_version_from<'life0, 'life1, 'async_trait>(
&'life0 self,
working_dir: &'life1 Path
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ProtoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn detect_version_from<'life0, 'life1, 'async_trait>( &'life0 self, working_dir: &'life1 Path ) -> Pin<Box<dyn Future<Output = Result<Option<String>, ProtoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Attempt to detect an applicable version from the provided working directory.
source§impl Downloadable<'_> for DenoLanguage
impl Downloadable<'_> for DenoLanguage
source§fn get_download_path(&self) -> Result<PathBuf, ProtoError>
fn get_download_path(&self) -> Result<PathBuf, ProtoError>
Return an absolute file path to the downloaded file.
This may not exist, as the path is composed ahead of time.
This is typically ~/.proto/temp/.
source§fn get_download_url(&self) -> Result<String, ProtoError>
fn get_download_url(&self) -> Result<String, ProtoError>
Return a URL to download the tool’s archive from a registry.
source§fn download<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
to_file: &'life1 Path,
from_url: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn download<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, to_file: &'life1 Path, from_url: Option<&'life2 str> ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,
Download the tool (as an archive) from its distribution registry
into the ~/.proto/temp folder and return an absolute file path.
A custom URL that points to the downloadable archive can be
provided as the 2nd argument.
source§impl Executable<'_> for DenoLanguage
impl Executable<'_> for DenoLanguage
source§fn find_bin_path<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_bin_path<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Find the absolute file path to the tool’s binary that will be executed.
This happens after a tool has been downloaded and installed.
source§fn get_bin_path(&self) -> Result<&Path, ProtoError>
fn get_bin_path(&self) -> Result<&Path, ProtoError>
Return an absolute file path to the executable binary for the tool.
source§impl Installable<'_> for DenoLanguage
impl Installable<'_> for DenoLanguage
source§fn get_archive_prefix(&self) -> Result<Option<String>, ProtoError>
fn get_archive_prefix(&self) -> Result<Option<String>, ProtoError>
Return a prefix that will be removed from all paths when
unpacking an archive and copying the files.
source§fn get_install_dir(&self) -> Result<PathBuf, ProtoError>
fn get_install_dir(&self) -> Result<PathBuf, ProtoError>
Return an absolute file path to the directory containing the installed tool.
This is typically ~/.proto/tools//.
source§fn install<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
install_dir: &'life1 Path,
download_path: &'life2 Path
) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn install<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, install_dir: &'life1 Path, download_path: &'life2 Path ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,
Run any installation steps after downloading and verifying the tool.
This is typically unzipping an archive, and running any installers/binaries.
source§impl Resolvable<'_> for DenoLanguage
impl Resolvable<'_> for DenoLanguage
source§fn get_resolved_version(&self) -> &str
fn get_resolved_version(&self) -> &str
Return the resolved version.
source§fn load_version_manifest<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<VersionManifest, ProtoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_version_manifest<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<VersionManifest, ProtoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Load the upstream version and release manifest.
source§fn resolve_version<'life0, 'life1, 'async_trait>(
&'life0 mut self,
initial_version: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<String, ProtoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_version<'life0, 'life1, 'async_trait>( &'life0 mut self, initial_version: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<String, ProtoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Given an initial version, resolve it to a fully qualifed and semantic version
according to the tool’s ecosystem.
source§fn set_version(&mut self, version: &str)
fn set_version(&mut self, version: &str)
Explicitly set the resolved version.
source§fn get_default_version(&self) -> Option<&str>
fn get_default_version(&self) -> Option<&str>
Return the version to be used as the global default.
source§impl Shimable<'_> for DenoLanguage
impl Shimable<'_> for DenoLanguage
source§fn create_shims<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_shims<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Create one or many shims in the root of the tool’s install directory.
source§fn get_shim_path(&self) -> Option<&Path>
fn get_shim_path(&self) -> Option<&Path>
Return an absolute path to the shim file if utilizing shims.
source§impl Tool<'_> for DenoLanguage
impl Tool<'_> for DenoLanguage
fn get_manifest_path(&self) -> Result<PathBuf, ProtoError>
fn before_setup<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,
fn setup<'life0, 'life1, 'async_trait>( &'life0 mut self, initial_version: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,
fn is_setup<'life0, 'life1, 'async_trait>( &'life0 mut self, initial_version: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,
fn after_setup<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,
fn cleanup<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,
fn before_teardown<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,
fn teardown<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,
fn after_teardown<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,
source§impl Verifiable<'_> for DenoLanguage
impl Verifiable<'_> for DenoLanguage
source§fn get_checksum_path(&self) -> Result<PathBuf, ProtoError>
fn get_checksum_path(&self) -> Result<PathBuf, ProtoError>
Return an absolute file path to the checksum file.
This may not exist, as the path is composed ahead of time.
This is typically ~/.prove/temp/.
source§fn get_checksum_url(&self) -> Result<Option<String>, ProtoError>
fn get_checksum_url(&self) -> Result<Option<String>, ProtoError>
Return a URL to download the tool’s checksum manifest from a registry.
source§fn verify_checksum<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_checksum_file: &'life1 Path,
_download_file: &'life2 Path
) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn verify_checksum<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _checksum_file: &'life1 Path, _download_file: &'life2 Path ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Verify the downloaded file using the checksum strategy for the tool.
Common strategies are SHA256 and MD5.
source§fn download_checksum<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
to_file: &'life1 Path,
from_url: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn download_checksum<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, to_file: &'life1 Path, from_url: Option<&'life2 str> ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,
If applicable, download all files necessary for verifying checksums.