load_cache

Function load_cache 

Source
pub fn load_cache(
    path: &PathBuf,
    current_signature: &[String],
) -> Option<Vec<SandboxInfo>>
Expand description

What: Load cached sandbox data when the stored signature matches the current list.

Inputs:

  • path: Filesystem location of the serialized SandboxCache JSON.
  • current_signature: Signature derived from the current install list for validation.

Output:

  • Some(Vec<SandboxInfo>) when the cache exists, deserializes, and signatures agree; None otherwise.

Details:

  • Reads the JSON, deserializes it, sorts both signatures, and compares them before returning the cached sandbox data.
  • Uses partial matching to load entries for packages that exist in both cache and current list.