Crate proto_pdk

Source

Macros§

anyhow
Construct an ad-hoc error from a string or existing non-anyhow error value.
api_enum
Wrap an enum with common derives and serde required attributes.
api_struct
Wrap a struct with common derives and serde required attributes.
api_unit_enum
Wrap a unit-only enum with common derives and serde required attributes.
exec_command
Calls the exec_command host function to execute a command on the host as a synchronous child process.
host_env
Calls the get_env_var or set_env_var host function to manage environment variables on the host.
host_log
Calls the host_log host function to log a message to the host’s terminal.
permutations
Generate all permutations for the provided OS and architecture mapping.
plugin_err
Return an error message wrapped in WithReturnCode , for use within #[plugin_fn].
real_path
Calls from_virtual_path on the host to convert the provided value to a real path from a virtual path.
send_request
Calls the send_request host function to send an HTTP request and return a response. Not OK responses must be handled by the guest.
virtual_path
Calls to_virtual_path on the host to convert the provided value to a virtual path from a real path.

Structs§

ArchiveSource
Source code is contained in an archive.
BuildInstructionsInput
Input passed to the build_instructions function.
BuildInstructionsOutput
Output returned by the build_instructions function.
BuilderInstruction
A builder and its parameters for installing the builder.
CalVer
Container for a calendar version.
Checksum
Represents a checksum for a specific algorithm.
CommandInstruction
A command and its parameters to be executed as a child process.
DependencyConfig
Configuration for one or many system dependencies (packages).
DetectVersionInput
Input passed to the detect_version_files function.
DetectVersionOutput
Output returned by the detect_version_files function.
DownloadPrebuiltInput
Input passed to the download_prebuilt function.
DownloadPrebuiltOutput
Output returned by the download_prebuilt function.
EmptyInput
Represents an empty input.
ExecCommandInput
Input passed to the exec_command host function.
ExecCommandOutput
Output returned from the exec_command host function.
ExecutableConfig
Configuration for generated shim and symlinked binary files.
FileLocator
A file system locator.
GitHubLocator
A GitHub release locator.
GitSource
Source code is located in a Git repository.
HostEnvironment
Information about the host environment (the current runtime).
HostLogInput
Input passed to the host_log host function.
InstallHook
Input passed to the pre_install and post_install hooks, while a proto install command is running.
LoadVersionsInput
Input passed to the load_versions function.
LoadVersionsOutput
Output returned by the load_versions function.
LocateExecutablesInput
Input passed to the locate_executables function.
LocateExecutablesOutput
Output returned by the locate_executables function.
NativeInstallInput
Input passed to the native_install function.
NativeInstallOutput
Output returned by the native_install function.
NativeUninstallInput
Input passed to the native_uninstall function.
NativeUninstallOutput
Output returned by the native_uninstall function.
ParseVersionFileInput
Input passed to the parse_version_file function.
ParseVersionFileOutput
Output returned by the parse_version_file function.
RegisterBackendInput
Input passed to the register_backend function.
RegisterBackendOutput
Output returned by the register_backend function.
RegisterToolInput
Input passed to the register_tool function.
RegisterToolOutput
Output returned by the register_tool function.
ResolveVersionInput
Input passed to the resolve_version function.
ResolveVersionOutput
Output returned by the resolve_version function.
RunHook
Input passed to the pre_run hook, before a proto run command or language binary is ran.
RunHookResult
Output returned from the pre_run hook.
SemVer
Container for a semantic version.
SendRequestInput
Input passed to the send_request host function.
SendRequestOutput
Output returned from the send_request host function.
SyncManifestInput
Input passed to the sync_manifest function.
SyncManifestOutput
Output returned by the sync_manifest function.
SyncShellProfileInput
Input passed to the sync_shell_profile function.
SyncShellProfileOutput
Output returned by the sync_shell_profile function.
TestEnvironment
Information about the current testing environment.
ToolContext
Information about the current state of the tool.
ToolInventoryMetadata
Controls aspects of the tool inventory.
ToolUnresolvedContext
Information about the current state of the tool.
UnpackArchiveInput
Input passed to the unpack_archive function.
UnresolvedParser
UrlLocator
A HTTPS URL locator.
VerifyChecksumInput
Output returned by the verify_checksum function.
VerifyChecksumOutput
Output returned by the verify_checksum function.
Version
SemVer version as defined by https://semver.org.
VersionReq
SemVer version requirement describing the intersection of some version comparators, such as >=1.2.3, <1.8.

Enums§

BuildInstruction
An instruction to execute.
BuildRequirement
Is required and must exist in the current environment.
ChecksumAlgorithm
Supported checksum algorithms.
ChecksumError
Errors that may occur from within a plugin.
DependencyName
A system dependency name in multiple formats.
HostArch
Architecture of the system environment.
HostLibc
Libc being used in the system environment.
HostLogTarget
Target where host logs should be written to.
HostOS
Operating system of the current environment.
HostPackageManager
Package manager of the system environment.
InstallStrategy
Supported strategies for installing a tool.
ParseKind
ParsePart
PluginError
Errors that may occur from within a plugin.
PluginLocator
Strategies and protocols for locating plugins.
PluginLocatorError
Errors during plugin locator parsing.
PluginType
Supported types of plugins.
SourceLocation
The location in which source code can be acquired.
SpecError
StringOrVec
Either a string, or a list of strings.
Switch
Either a boolean representing on or off, or a string representing on with a message.
SystemDependency
Represents a system dependency (one or many packages) to install.
UnresolvedVersionSpec
Represents an unresolved version or alias that must be resolved to a fully-qualified version.
VersionSpec
Represents a resolved version or alias.
VirtualPath
A container for WASI virtual paths that can also keep a reference to the original real path.

Functions§

add_host_paths
Append paths to the PATH environment variable on the host machine.
check_supported_os_and_arch
Validate the current host OS and architecture against the supported list of target permutations.
clean_version_req_string
Cleans a version requirement string by removing * version parts, and correcting AND operators.
clean_version_string
Cleans a potential version string by removing a leading v or V.
command_exists
Check whether a command exists or not on the host machine.
exec
Execute a command on the host with the provided input.
exec_captured
Execute a command on the host and capture its output (pipe).
exec_streamed
Execute a command on the host and stream its output to the console (inherit).
fetch
Fetch the requested input and return a response.
fetch_bytes
Fetch the provided URL and return the response as bytes.
fetch_json
Fetch the provided URL and deserialize the response as JSON.
fetch_text
Fetch the provided URL and return the response as text.
get_calver_regex
Get a regex pattern that matches calendar versions (calver). For example: 2024-02-26, 2024-12, 2024-01-alpha, etc.
get_host_env_var
Return the value of an environment variable on the host machine.
get_host_environment
Return information about the host environment.
get_plugin_id
Return the ID for the current plugin.
get_semver_regex
Get a regex pattern that matches semantic versions (semver). For example: 1.2.3, 6.5.4, 7.8.9-alpha, etc.
get_target_triple
Return a Rust target triple for the current host OS and architecture.
get_test_environment
Return information about the testing environment.
get_tool_config
Get proto tool configuration that was configured in a .prototools file.
into_real_path
Convert the provided path into a PathBuf instance, with the prefix resolved absolutely to the host.
into_virtual_path
Convert the provided path into a VirtualPath instance, with the prefix resolved to the WASM virtual whitelist.
is_alias_name
Returns true if the provided value is an alias. An alias is a word that maps to version, for example, “latest” -> “1.2.3”.
is_calver
Returns true if the provided value is a calendar version string.
is_semver
Returns true if the provided value is a semantic version string.
load_git_tags
Load all Git tags from the provided remote URL. The git binary must exist on the host machine.
parse
Parse the provided string and determine the output format. Since an unresolved version can be many things, such as an alias, version requirement, semver, or calver, we need to parse this manually to determine the correct output.
parse_multi
Parse the provided string as a list of version requirements, as separated by ||. Each requirement will be parsed individually with parse.
set_host_env_var
Set the value of an environment variable on the host machine.

Type Aliases§

AnyResult
Represents any result (using anyhow).
ToolMetadataInputDeprecated
ToolMetadataOutputDeprecated