PluginFunction

Enum PluginFunction 

Source
pub enum PluginFunction {
Show 15 variants RegisterTool, RegisterBackend, DetectVersionFiles, ParseVersionFile, LoadVersions, ResolveVersion, DownloadPrebuilt, BuildInstructions, UnpackArchive, VerifyChecksum, NativeInstall, NativeUninstall, LocateExecutables, SyncManifest, SyncShellProfile,
}
Expand description

Enumeration of all available plugin functions that can be implemented by plugins.

This enum provides type-safe access to plugin function names and eliminates the risk of typos when calling plugin functions. Each variant corresponds to a specific plugin function with its associated input/output types.

Variants§

§

RegisterTool

Register and configure a tool with proto.

Called when proto first loads a plugin to get basic metadata about the tool including its name, type, and configuration schema.

Input: RegisterToolInput | Output: RegisterToolOutput

§

RegisterBackend

Register a backend with proto.

Allows plugins to define custom backends for sourcing tools from locations other than the default registry.

Input: RegisterBackendInput | Output: RegisterBackendOutput

§

DetectVersionFiles

Detect version files in a project.

Returns a list of file patterns that should be checked for version information when auto-detecting tool versions.

Input: DetectVersionInput | Output: DetectVersionOutput

§

ParseVersionFile

Parse version information from files.

Extracts version specifications from configuration files like .nvmrc, package.json, pyproject.toml, etc.

Input: ParseVersionFileInput | Output: ParseVersionFileOutput

§

LoadVersions

Load available versions for a tool.

Fetches the list of available versions that can be installed, including version aliases like “latest” or “lts”.

Input: LoadVersionsInput | Output: LoadVersionsOutput

§

ResolveVersion

Resolve version specifications to concrete versions.

Takes version requirements or aliases and resolves them to specific installable versions.

Input: ResolveVersionInput | Output: ResolveVersionOutput

§

DownloadPrebuilt

Download prebuilt tool archives.

Provides URLs and metadata for downloading pre-compiled tool binaries instead of building from source.

Input: DownloadPrebuiltInput | Output: DownloadPrebuiltOutput

§

BuildInstructions

Provide build instructions for tools.

Returns the steps needed to build a tool from source, including dependencies, build commands, and environment requirements.

Input: BuildInstructionsInput | Output: BuildInstructionsOutput

§

UnpackArchive

Unpack downloaded archives.

Handles custom unpacking logic for tool archives when the default extraction methods are insufficient.

Input: UnpackArchiveInput | Output: None

§

VerifyChecksum

Verify download checksums.

Provides custom checksum verification logic for downloaded tool archives to ensure integrity.

Input: VerifyChecksumInput | Output: VerifyChecksumOutput

§

NativeInstall

Native tool installation.

Handles tool installation using the tool’s own installation methods rather than proto’s standard process.

Input: NativeInstallInput | Output: NativeInstallOutput

§

NativeUninstall

Native tool uninstallation.

Handles tool removal using the tool’s own uninstallation methods rather than simple directory deletion.

Input: NativeUninstallInput | Output: NativeUninstallOutput

§

LocateExecutables

Locate tool executables.

Identifies where executables are located within an installed tool and configures them for proto’s shim system.

Input: LocateExecutablesInput | Output: LocateExecutablesOutput

§

SyncManifest

Sync the tool manifest.

Allows plugins to update proto’s inventory of installed versions with external changes.

Input: SyncManifestInput | Output: SyncManifestOutput

§

SyncShellProfile

Sync shell profile configuration.

Configures shell environment variables and PATH modifications needed for the tool to work properly.

Input: SyncShellProfileInput | Output: SyncShellProfileOutput

Implementations§

Source§

impl PluginFunction

Source

pub fn as_str(&self) -> &'static str

Get the string representation of the plugin function name.

This returns the actual function name that should be used when calling the plugin function via WASM.

Trait Implementations§

Source§

impl AsRef<str> for PluginFunction

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for PluginFunction

Source§

fn clone(&self) -> PluginFunction

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PluginFunction

Source§

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

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

impl Hash for PluginFunction

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PluginFunction

Source§

fn eq(&self, other: &PluginFunction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for PluginFunction

Source§

impl Eq for PluginFunction

Source§

impl StructuralPartialEq for PluginFunction

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.