Skip to main content

module_to_cached

Function module_to_cached 

Source
pub fn module_to_cached(
    module: &ModuleInfo,
    fingerprint: SourceFingerprint,
    complexity_extracted: bool,
    call_facts_extracted: bool,
) -> CachedModule
Expand description

Convert a ModuleInfo to a CachedModule for storage.

The SourceFingerprint comes from std::fs::metadata() at parse time and enables fast cache validation on subsequent runs.

call_facts_extracted is true when the run parsed the module with its call facts. Only then does the entry store them. A run that reads no call facts passes false, so it does not pay their encode, and the entry records that the facts are absent.