Skip to main content

Module precache

Module precache 

Source

Structs§

CmdCache
Serialized command existence cache.

Constants§

CACHE_ENV_VAR
Environment variable name for the command existence cache.

Functions§

build_cache
Build a cache by checking each command with the provided closure.
build_cache_from_resolved
Build a cache from externally resolved command existence results.
cache_to_json
Serialize a cache to JSON.
collect_unique_commands
Collect all unique command names referenced by when_command_exists across all abbreviation rules in the config.
compute_fingerprint
Compute a fingerprint from PATH, config mtime, and shell name.
config_mtime
Get the mtime of a config file as seconds since epoch. Returns 0 if the file doesn’t exist or metadata can’t be read.
export_statement
Generate a shell export statement for the cache.
load_cache
Load and validate a cache from the environment variable.
parse_cache
Parse a cache from JSON, returning None on any failure.
parse_resolved
Parse a "cmd1=1,cmd2=0,..." string into a HashMap<String, bool>.