Skip to main content

sniff_headers

Function sniff_headers 

Source
pub fn sniff_headers(src: &str) -> HeaderSniff
Expand description

Best-effort detection of a document’s target version AND packaging axis from its source text — see sniff_version’s doc comment for the version-detection rules. The one addition: a use-shaped header line (is_use_header) sets both version = Some(V0_1) and envelope_headers = true, so the CLI’s detection ladder can pin LoadMode::Envelopes off it.