Skip to main content

Module routines

Module routines 

Source
Expand description

Cache path helpers and installed-routine discovery.

Routines are stored under ProjectDirs::cache_dir():

cache/routines/<name>/<version>/<target_triple>/plugin/<library>
cache/routines/<name>/<version>/<target_triple>/descriptor.json

§Version resolution

find_latest_installed_version and default run behavior use lexicographic sorting on version directory names. The last sorted entry is treated as “latest”. This is not semver-aware (e.g. 1.9.0 sorts after 1.10.0). Pin versions with run <name>@<version>.

Functions§

cache_root
Root cache directory (proj_dirs.cache_dir()).
descriptor_path
Path to descriptor.json for an installed routine version and target.
find_latest_installed_version
Lexicographically greatest installed version directory name, if any.
host_target_triple
Host target triple from rustc -vV (host: line).
installed_routine_names
Sorted routine names that have at least one installed version directory.
installed_versions_for_routine
Version directory names for a routine, sorted lexicographically.
is_installed_for_target
Whether the plugin library file exists for the given routine, version, and target.
platform_library_filename
Platform-specific dynamic library filename for a routine name stem.
plugin_dir
cache/routines/<name>/<version>/<target_triple>/plugin.
plugin_library_path
Full path to the installed plugin dynamic library file.
routine_root
cache/routines/<name>.
routine_target_root
cache/routines/<name>/<version>/<target_triple>.
routine_version_root
cache/routines/<name>/<version>.
routines_root
cache/routines — parent of all installed routine names.