mimetypes
File Extension to MIME Type Mapping
Functions
| Function | Description |
|---|---|
_mime_byte_at | Internal byte reader. |
_mime_copy | Internal: copy literal to output. |
_mime_eq | Internal: compare strings. |
mime_type | Get MIME type for file extension (without dot). Returns length, -1 if unknown. |
mime_guess | Guess MIME type from filename/path. Extracts extension after last dot. |
mime_is_text | Check if extension maps to a text/* type. |
Details
_mime_byte_at
fn _mime_byte_at(buf: &i8, idx: i64) -> i64Internal byte reader.
_mime_copy
fn _mime_copy(dst: &i8, src: &i8, len: i64) -> i64Internal: copy literal to output.
_mime_eq
fn _mime_eq(a: &i8, alen: i64, b: &i8, blen: i64) -> i64Internal: compare strings.
mime_type
fn mime_type(ext: &i8, elen: i64, out: &i8, max: i64) -> i64Get MIME type for file extension (without dot). Returns length, -1 if unknown.
mime_guess
fn mime_guess(path: &i8, plen: i64, out: &i8, max: i64) -> i64Guess MIME type from filename/path. Extracts extension after last dot.
mime_is_text
fn mime_is_text(ext: &i8, elen: i64) -> i64Check if extension maps to a text/* type.