Skip to main content

Crate proto_core

Crate proto_core 

Source

Re-exports§

pub use version_spec;
pub use warpgate;

Modules§

cfg
checksum
flow
layout
registry
reporter
utils

Structs§

DataLocator
An inline data locator.
EnvFile
FileLocator
A file system locator.
FormatOptions
Options for formatting a version into a string.
GitHubLocator
A GitHub release locator.
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.
LockRecord
PartialProtoBackendConfig
PartialProtoBuildConfig
PartialProtoConfig
PartialProtoOfflineConfig
PartialProtoPluginsConfig
PartialProtoSettingsConfig
PartialProtoShellConfig
PartialProtoToolConfig
PartialProtoToolVersionsSourceConfig
ProtoBackendConfig
ProtoBuildConfig
ProtoConfig
ProtoConfigEnvOptions
ProtoConfigFile
ProtoDirEntry
ProtoEnvironment
ProtoFileManager
ProtoHostData
Data passed to proto specific host functions.
ProtoLock
ProtoOfflineConfig
ProtoPluginsConfig
ProtoSettingsConfig
ProtoShellConfig
ProtoToolConfig
ProtoToolVersionsSourceConfig
Range
A version range composed of clauses, in which any clause may match, for example ^1 || 2.3.4 - 3.0.0 || >=4, <5.
RegistryConfig
Configures an individual plugin registry.
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.
SharedString
An immutable string that is cheap to clone, used for the scope, pre-release, and build metadata of versions and requirements.
SyntaxParser
Tool
ToolContext
ToolManifest
ToolManifestVersion
ToolSpec
TrustStore
Determines which config files are trusted. A config is trusted when the user has trusted the file itself or a directory it’s within (with proto trust), when it’s within a directory listed in PROTO_TRUSTED_PATHS, or when running in CI.
TrustedPluginRecord
A plugin that was loaded for a tool, and where it came from.
UntrustedPluginRecord
A plugin that was configured in a config file, but was ignored because the config has not been trusted.
UrlLocator
A HTTPS URL locator.
Version
A version in either calendar or semantic format, with support for scopes, pre-releases, and build metadata.
VersionResolver

Enums§

BuiltinPlugins
Clause
A single clause within a version range.
ConfigMode
DetectStrategy
EnvVar
Op
The comparison operator of a requirement.
PartialBuiltinPlugins
PartialEnvVar
PinLocation
PluginLocator
Strategies and protocols for locating plugins.
PluginType
ProtoConfigError
ProtoEnvError
ProtoLoaderError
ProtoToolError
Rule
SpecError
TrustSource
Why a config file is trusted.
TrustState
The trust state of a config file.
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.

Constants§

ENV_FILE_KEY
MANIFEST_NAME
PROTO_CONFIG_NAME
PROTO_LOCK_NAME
PROTO_PLUGIN_KEY
SCHEMA_PLUGIN_KEY

Statics§

ENV_VAR
ENV_VAR_SUB

Traits§

FormatsVersion
Trait for formatting a version into a string with custom options.
MatchesRange
Trait for matching a range against the implementing type.
MatchesRequirement
Trait for matching a requirement against the implementing type.
MatchesVersion
Trait for matching a version against the implementing type.

Functions§

create_proto_host_functions
Create a list of our built-in host function with warpgate provided host functions.
fast_list_clone
Cloning an entire list, like Vec, is very costly as it clones the entire structure. This helper allows you to clone just the values, which is much faster if you don’t need the list features.
fast_map_clone
Cloning an entire map, like IndexMap, is very costly as it clones the entire structure. This helper allows you to clone just the keys and values, which is much faster if you don’t need the map features.
find_debug_locator_with_fallback
get_builtin_registry
get_lockable_libc
Return the libc to record in the lockfile for the provided platform. A libc is only recorded for Linux, as it’s the only operating system where artifacts are commonly distributed for multiple libcs (GNU and musl).
get_proto_version
get_sensitive_config
Return the security-sensitive settings configured in the provided config, with unconfigured settings removed, for display purposes. Returns None if the config has none, in which case it does not need to be trusted.
get_sensitive_fields
Return the paths of the security-sensitive settings configured in the provided config, like env or plugins.tools, for display purposes. Returns an empty list if the config has none.
hash_path
Hash a path, for use as an identifier.
inject_proto_manifest_config
is_archive_file
is_cache_enabled
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_offline
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_schema_config
load_schema_plugin_with_proto
load_tool
load_tool_from_locator
locate_plugin
match_highest_version
normalize_path
Resolve symlinks and relative components so that a path is trusted regardless of the path used to reach it.
normalize_version
Normalizes a version as some tools publish it into one that the strict parsers accept, for example a PEP 440 version like 3.15.0rc2.
now
read_json_file_with_lock
resolve_version
split_config
Split a config into the settings that are safe to apply from any config, and the settings that are security-sensitive and require trust.
write_json_file_with_lock

Type Aliases§

ParseError
ToolMetadata