pub struct NodeLanguage {
    pub base_dir: PathBuf,
    pub bin_path: Option<PathBuf>,
    pub shim_path: Option<PathBuf>,
    pub temp_dir: PathBuf,
    pub version: Option<String>,
    /* private fields */
}

Fields§

§base_dir: PathBuf§bin_path: Option<PathBuf>§shim_path: Option<PathBuf>§temp_dir: PathBuf§version: Option<String>

Implementations§

source§

impl NodeLanguage

source

pub fn new<P: AsRef<Proto>>(proto: P) -> Self

Trait Implementations§

source§

impl Debug for NodeLanguage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Describable<'_> for NodeLanguage

source§

fn get_id(&self) -> &str

Return an identifier for the tool. Will also be used in variables, file names, and more.
source§

fn get_name(&self) -> String

Return a human readable name of the tool.
source§

impl Detector<'_> for NodeLanguage

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,

Attempt to detect an applicable version from the provided working directory.
source§

impl Downloadable<'_> for NodeLanguage

source§

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/<file>.
source§

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,

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 NodeLanguage

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,

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>

Return an absolute file path to the executable binary for the tool.
source§

fn get_globals_bin_dir(&self) -> Result<Option<PathBuf>, ProtoError>

Return an absolute file path to the directory containing all globally installed packages.
source§

impl Installable<'_> for NodeLanguage

source§

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>

Return an absolute file path to the directory containing the installed tool. This is typically ~/.proto/tools/<tool>/<version>.
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,

Run any installation steps after downloading and verifying the tool. This is typically unzipping an archive, and running any installers/binaries.
source§

fn should_unpack(&self) -> bool

Whether or not the downloaded file should be unpacked before installing.
source§

fn uninstall<'life0, 'life1, 'async_trait>( &'life0 self, install_dir: &'life1 Path ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Uninstall the tool by deleting the install directory.
source§

impl Resolvable<'_> for NodeLanguage

source§

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,

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,

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)

Explicitly set the resolved version.
source§

fn get_default_version(&self) -> Option<&str>

Return the version to be used as the global default.
source§

impl Shimable<'_> for NodeLanguage

source§

fn create_shims<'life0, 'async_trait>( &'life0 mut self, find_only: bool ) -> 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>

Return an absolute path to the shim file if utilizing shims.
source§

impl Tool<'_> for NodeLanguage

source§

fn as_any(&self) -> &dyn Any

source§

fn get_manifest(&self) -> Result<&Manifest, ProtoError>

source§

fn get_manifest_mut(&mut self) -> Result<&mut Manifest, ProtoError>

source§

fn get_tool_dir(&self) -> &Path

source§

fn get_manifest_path(&self) -> PathBuf

source§

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,

source§

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,

source§

fn setup_shims<'life0, 'async_trait>( &'life0 mut self, force: bool ) -> Pin<Box<dyn Future<Output = Result<(), ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

source§

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,

source§

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,

source§

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,

source§

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,

source§

fn teardown<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

source§

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 NodeLanguage

source§

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 ~/.proto/temp/<file>.
source§

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,

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,

If applicable, download all files necessary for verifying checksums.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where C: Color,

Set the background color generically. Read more
§

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black
§

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color to black
§

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red
§

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color to red
§

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green
§

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color to green
§

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color to yellow
§

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue
§

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color to blue
§

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to magenta
§

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple
§

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to purple
§

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color to cyan
§

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white
§

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color to white
§

fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

Change the background color to the terminal default
§

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color to bright red
§

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color to bright white
§

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold
§

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim
§

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized
§

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors
§

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text
§

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_> ) -> Result<(), Error>

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> DebugAny for Twhere T: Any + Debug,

§

impl<T> UnsafeAny for Twhere T: Any,