pub fn guess_and_report_path(path: impl AsRef<Path>) -> Result<DetectionReport>Expand description
Guesses format candidates and generates a detection report for a filesystem path.
ยงExamples
use ctb_formats_detection::{guess_and_report_path, FormatId, OsPath};
let dir = tempfile::tempdir()?;
let path: OsPath = dir.path().join("archive.tar.gz");
std::fs::write(&path, [0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00])?;
let report = guess_and_report_path(&path)?;
assert_eq!(report.candidates[0].format_id, Some(FormatId::Gzip));