Skip to main content

Crate proto_pdk

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].
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.

Structs§

ActivateEnvironmentInput
Input passed to the activate_environment function.
ActivateEnvironmentOutput
Output returned by the activate_environment function.
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.
Checksum
Represents a checksum for a specific algorithm.
CommandInstruction
A command and its parameters to be executed as a child process.
DataLocator
An inline data locator.
DefineBackendConfigOutput
Output returned from the define_backend_config function.
DefineToolConfigOutput
Output returned from the define_tool_config function.
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 executable files.
FileLocator
A file system locator.
FormatOptions
Options for formatting a version into a string.
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.
Id
A compact string identifier for use within records, key lookups, and more. Supports unicode alphanumeric characters, forward slash /, period ., underscore _, and dash -. A leading @ is supported to support npm package names.
IdError
ID errors.
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.
PathParseError
Error type for path parsing failures.
PinVersionInput
Input passed to the pin_version function.
PinVersionOutput
Output returned by the pin_version function.
PluginContext
Information about the current state of the plugin, after a version has been resolved.
PluginUnresolvedContext
Information about the current state of the plugin, before a version has been resolved.
Range
A version range composed of clauses, in which any clause may match, for example ^1 || 2.3.4 - 3.0.0 || >=4, <5.
RealPath
Represents a real absolute path on the host system.
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.
RegistryLocator
An OCI registry locator.
Requirement
A version requirement composed of a comparison operator and a full or partial version to match against. Build metadata is accepted when parsing, but is otherwise ignored.
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 executable is ran.
RunHookResult
Output returned from the pre_run hook.
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.
SyntaxParser
TestEnvironment
Information about the current testing environment.
ToolInventoryOptions
Controls aspects of the tool inventory.
ToolLockOptions
Options related to lockfile integration.
UnpackArchiveInput
Input passed to the unpack_archive function.
UnpinVersionInput
Input passed to the unpin_version function.
UnpinVersionOutput
Output returned by the unpin_version function.
UrlLocator
A HTTPS URL locator.
VerifyChecksumInput
Output returned by the verify_checksum function.
VerifyChecksumOutput
Output returned by the verify_checksum function.
Version
A version in either calendar or semantic format, with support for scopes, pre-releases, and build metadata.
VirtualPath
Represents a virtual absolute path on the guest system.

Enums§

BuildInstruction
An instruction to execute. All paths are relative from the build directory.
BuildRequirement
Is required and must exist in the current environment.
ChecksumAlgorithm
Supported checksum algorithms.
ChecksumError
Errors that may occur from within a plugin.
Clause
A single clause within a version range.
DependencyName
A system dependency name in multiple formats.
HookFunction
Enumeration of all available hook functions that can be implemented by plugins.
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.
Op
The comparison operator of a requirement.
PluginError
Errors that may occur from within a plugin.
PluginFunction
Enumeration of all available plugin functions that can be implemented by plugins.
PluginLocator
Strategies and protocols for locating plugins.
PluginLocatorError
Errors during plugin locator parsing.
PluginType
Supported types of plugins.
Rule
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.
VersionKind
The kind of version, either calendar or semantic.
VersionSpec
Represents a resolved version or alias.

Statics§

ID_CLEAN_PATTERN
Pattern that removes unsupported characters from an identifier.
ID_PATTERN
Pattern that all identifiers are matched against. Supports unicode alphanumeric characters, forward slash /, period ., underscore _, and dash -. A leading @ is supported to support npm package names.

Traits§

FormatsVersion
Trait for formatting a version into a string with custom options.
MatchesVersion
Trait for matching a version against the implementing type.
RealPathExt
Extension trait for RealPath to provide additional functionality.
VirtualPathExt
Extension trait for VirtualPath to provide additional functionality.

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.
command_exists
Check whether a command exists or not on the host machine.
convert_to_real_native_path
Convert the provided virtual guest path to a real host path, returning a PathBuf instead of a RealPath. If the guest path does not match any of the provided virtual paths, it will return the original path.
convert_to_real_path
Convert the provided virtual guest path to a real host path. If the guest path does not match any of the provided virtual paths, it will return None.
convert_to_virtual_path
Convert the provided real host path to a virtual guest path. If the host path does not match any of the provided virtual paths, it will return None.
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_backend_config
Get proto backend configuration that was configured in a .prototools file.
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_host_to_guest_paths
Return a mapping of virtual paths, from host to guest paths.
get_plugin_id
Return the ID for the current plugin.
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.
is_calver_like
Returns true if the provided value looks like a calendar version string, instead of a semantic version string. This is used to determine which parser to use.
is_semver_like
Returns true if the provided value looks like a semver version string, instead of a calendar version string. This is used to determine which parser to use.
load_git_tags
Load all Git tags from the provided remote URL. The git executable must exist on the host machine.
set_host_env_var
Set the value of an environment variable on the host machine.
sort_paths_list
Sort paths from longest to shortest host path, so that prefix replacing is deterministic and accurate.

Type Aliases§

AnyResult
Represents any result (using anyhow).
ConfigSchema
ParseError