Skip to main content

ensure_http_cache_dir_with

Function ensure_http_cache_dir_with 

Source
pub fn ensure_http_cache_dir_with<F>(
    identifier: &str,
    root: F,
) -> Result<CacheDirOutcome>
where F: FnOnce() -> Option<PathBuf>,
Expand description

ensure_http_cache_dir with a caller-supplied cache root, so the repaired directory is exactly the one the app’s Tauri resolves:

use rightkit_tauri_shell::startup_cache::{ensure_http_cache_dir_with, user_cache_root};
ensure_http_cache_dir_with(identifier, user_cache_root)?;
// or, once an AppHandle exists: || app.path().cache_dir().ok()

root returns None when it cannot resolve a cache directory (reported as NotFound). The identifier rules are the same, and are checked before root is called.