Lines Matching refs:cache
69 pub fn from_path(file_path: &Path, cache: &Cache) -> Result<Self> { in from_path()
77 Ok(FileMetadata::from_file(file_path, &metadata, cache)?) in from_path()
101 pub fn from_file(file_path: &Path, metadata: &fs::Metadata, cache: &Cache) -> Result<Self> { in from_file()
108 let (digest, cache_key) = get_or_compute_digest(file_path, metadata, cache)?; in from_file()
202 let cache = Cache::read().unwrap_or_default(); in fingerprint_partitions() localVariable
217 FileMetadata::from_path(&file_path, &cache).unwrap(), in fingerprint_partitions()
221 cache.write(&results)?; in fingerprint_partitions()
260 cache: &Cache, in get_or_compute_digest()
262 let cache_key = cache.cache_key(file_path, metadata)?; in get_or_compute_digest()
264 if let Some(cached_digest) = cache.get(&cache_key) { in get_or_compute_digest()
537 let mut cache = Cache::default(); in get_or_compute_digest_small_file() localVariable
538 let (digest, cache_key) = get_or_compute_digest(&file_path, &metadata, &cache).unwrap(); in get_or_compute_digest_small_file()
557 cache.data.insert(cache_key, "test-saved-cache-digest".to_string()); in get_or_compute_digest_small_file()
558 let (digest, _) = get_or_compute_digest(&file_path, &metadata, &cache).unwrap(); in get_or_compute_digest_small_file()
602 let cache = Cache::default(); in fingerprint_file_for_file() localVariable
603 let entry = FileMetadata::from_path(&file_path, &cache).unwrap(); in fingerprint_file_for_file()
628 let cache = Cache::default(); in fingerprint_file_for_relative_symlink() localVariable
629 let entry = FileMetadata::from_path(&link, &cache).unwrap(); in fingerprint_file_for_relative_symlink()
645 let cache = Cache::default(); in fingerprint_file_for_absolute_symlink() localVariable
646 let entry = FileMetadata::from_path(&link, &cache).unwrap(); in fingerprint_file_for_absolute_symlink()
663 let cache = Cache::default(); in fingerprint_file_for_directory() localVariable
664 let entry = FileMetadata::from_path(&newdir_path, &cache).unwrap(); in fingerprint_file_for_directory()
670 let cache = Cache::default(); in fingerprint_file_on_bad_path_reports_err() localVariable
671 if FileMetadata::from_path(Path::new("testdata/not_exist"), &cache).is_ok() { in fingerprint_file_on_bad_path_reports_err()
989 let cache = Cache::default(); in test_write_and_read_cache_file() localVariable
990 let write_result = cache.write_to_file(&results, &file_path); in test_write_and_read_cache_file()
993 let cache = Cache::read_from_file(&file_path).unwrap(); in test_write_and_read_cache_file() localVariable
994 assert_eq!(cache.get("key1"), Some(&"value1".to_string())); in test_write_and_read_cache_file()
995 assert_eq!(cache.get("key2"), Some(&"value2".to_string())); in test_write_and_read_cache_file()
1001 let cache = Cache::read_from_file(bad_path).unwrap_or_default(); in test_read_cache_file_no_file() localVariable
1002 assert!(cache.data.is_empty()); in test_read_cache_file_no_file()
1011 let cache = Cache::read_from_file(&file_path).unwrap_or_default(); in test_read_cache_file_invalid_file() localVariable
1012 assert!(cache.data.is_empty()); in test_read_cache_file_invalid_file()