Skip to main content

detect_format

Function detect_format 

Source
pub fn detect_format(
    prefix: &[u8],
    name: &str,
    content_type: Option<&str>,
) -> Detection
Expand description

Combine all three signals, with magic bytes taking precedence.

prefix may be empty (nothing fetched yet); name is the filename or URL; content_type is the server’s header if it sent one.