pub fn load(
layout: &RepoLayout,
tree_hash: &Hash,
expected_filter_hash: &Hash,
) -> Result<Option<(SparseManifest, SparseProof)>, CacheError>Expand description
Load a cached delivery for (tree_hash, filter_hash). Returns
Ok(None) for a fresh repo / cache miss; Err(_) only for I/O or
wire failures.
The function does not re-verify the bitmap-root against the bytes — that’s the verifier’s job. It only enforces that the cached filter hash matches the caller’s expected hash, so a stale cache for a different filter doesn’t get silently returned.
§Errors
CacheError::Io— I/O failure other than “not found”.CacheError::Wire— the cache file exists but is malformed.CacheError::FilterMismatch— cache exists for the tree but for a different filter.