Skip to main content

detect_format

Function detect_format 

Source
pub fn detect_format(
    content: &str,
    filename: Option<&str>,
) -> Result<FileFormat, FormatError>
Expand description

Detect file format from content and optional filename

ยงErrors

Returns FormatError::UnknownFormat if the format cannot be detected, or FormatError::UnsupportedBinary if the file appears to be binary but the specific format cannot be determined.