guess_and_report_vec

Function guess_and_report_vec 

Source
pub fn guess_and_report_vec(bytes: Vec<u8>) -> Result<DetectionReport>
Expand description

Guesses format candidates and generates a detection report from raw bytes. The report populates file_origin as FileOrigin::Synthetic.

ยงExamples

use ctb_formats_detection::{guess_and_report_vec, FormatId};

let gz_bytes = vec![0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00];
let report = guess_and_report_vec(gz_bytes)?;
assert_eq!(report.candidates[0].format_id, Some(FormatId::Gzip));