Skip to main content

search_with_cache

Function search_with_cache 

Source
pub fn search_with_cache(
    request: &SearchRequest,
    cache: Option<&dyn DiscoveryCache>,
) -> Result<Vec<FileEntry>, PathError>
Available on crate feature search only.
Expand description

Search using an explicit discovery cache.

§Cache rules

PolicyWithout cacheWith cache
CachePolicy::BypassScan onlyScan only (no read/write)
CachePolicy::ReadThroughScan onlyRead then maybe write
CachePolicy::RefreshScan onlyScan and write

There is no process-global default cache. Callers that want caching must supply their own [MemoryCache] or crate::cache::PersistentCache.

§Filesystem access

Yes. Requires the root to exist.

§Security

Cache hits are performance artifacts only. Re-validate paths before security-sensitive use.