Skip to main content

try_open_cached

Function try_open_cached 

Source
pub fn try_open_cached(
    store_path: &Path,
    pbf_path: &Path,
) -> Result<Option<(NodeStore, NodeCacheMeta)>, GeolithError>
Expand description

Try to open a cached node store, validating against the current PBF file.

Returns Some(NodeStore) if:

  • The node store .bin file exists
  • The sidecar .meta.json exists and is valid JSON
  • The PBF file size and modification time match the cached metadata

Returns None if the cache is stale or missing (caller should rebuild).

§Errors

Returns an error only on I/O failures that aren’t “file not found”.