load_cached_spec

Function load_cached_spec 

Source
pub fn load_cached_spec<P: AsRef<Path>>(
    cache_dir: P,
    spec_name: &str,
) -> Result<CachedSpec, Error>
Expand description

Loads a cached OpenAPI specification from the binary cache with optimized version checking.

This function uses a global cache metadata file for fast version checking before loading the full specification, significantly improving performance.

§Arguments

  • cache_dir - The directory containing cached spec files
  • spec_name - The name of the spec to load (without binary extension)

§Returns

  • Ok(CachedSpec) - The loaded and deserialized specification
  • Err(Error) - If the file doesn’t exist or deserialization fails

§Errors

Returns an error if the cache file doesn’t exist or if deserialization fails