load_from_disk

Function load_from_disk 

Source
pub fn load_from_disk(path: &Path)
Expand description

What: Load the official index from path if a valid JSON exists.

Inputs:

  • path: File path to read JSON from

Output:

  • Replaces the in-memory index on success; ignores errors and leaves it unchanged on failure.

Details:

  • Silently ignores IO or deserialization failures to keep startup resilient.
  • Rebuilds the name_to_idx HashMap after deserialization for O(1) lookups.