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§
Trait Implementations§
Source§impl AsRef<str> for PluginFunction
impl AsRef<str> for PluginFunction
Source§impl Clone for PluginFunction
impl Clone for PluginFunction
Source§fn clone(&self) -> PluginFunction
fn clone(&self) -> PluginFunction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PluginFunction
impl Debug for PluginFunction
Source§impl Hash for PluginFunction
impl Hash for PluginFunction
Source§impl PartialEq for PluginFunction
impl PartialEq for PluginFunction
impl Copy for PluginFunction
impl Eq for PluginFunction
impl StructuralPartialEq for PluginFunction
Auto Trait Implementations§
impl Freeze for PluginFunction
impl RefUnwindSafe for PluginFunction
impl Send for PluginFunction
impl Sync for PluginFunction
impl Unpin for PluginFunction
impl UnwindSafe for PluginFunction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.