Skip to main content

save_detector_cache

Function save_detector_cache 

Source
pub fn save_detector_cache(
    detectors: &[DetectorSpec],
    cache_path: &Path,
) -> Result<(), Error>
Expand description

Save detectors to a JSON cache file for fast subsequent loads.

§Examples

use keyhog_core::{DetectorSpec, save_detector_cache};
use std::path::Path;

let detectors: Vec<DetectorSpec> = Vec::new();
save_detector_cache(&detectors, Path::new(".keyhog-cache.json"))?;