Skip to main content

Module detect

Module detect 

Source
Expand description

Format detection: MIME type first, then file extension, then content sniffing.

Enums§

Format
A document format this crate knows about (whether or not its feature is enabled).

Functions§

extension
File extension of a file name, if any.
from_extension
Map a file extension (with or without the dot, any case) to a format.
from_mime
Map a MIME type (parameters ignored) to a format.
is_zip
Whether the bytes start like a zip archive.
looks_textual
Whether the bytes look like text (no NUL bytes in the first 8 KiB).
ole_is_workbook
Whether an OLE compound file holds an Excel workbook stream (Workbook or Book). Word, PowerPoint and Outlook files are OLE too but are not supported.
sniff
Guess the format from the first bytes. Zip containers are not resolved here (see crate::extract), because that requires opening the archive.