stdlib/mimeView source ↗
mime
15 items · generated by scribe fromstdlib/mime.fd· synced 2026-11-15
Contents
- mime_default (function)
- mime_from_ext (function)
- mime_from_path (function)
- mime_known (function)
- mime_ext_for (function)
- mime_base (function)
- mime_param (function)
- mime_is_text (function)
- mime_is_image (function)
- mime_is_audio (function)
- mime_is_video (function)
- mime_is_compressible (function)
mime_default
Default type when nothing matches.
pub fn mime_default() -> str {Returns: str
Defined at line 200
mime_from_ext
MIME type for a file extension (with or without leading dot). Returns “application/octet-stream” when unknown.
pub fn mime_from_ext(ext: str) -> str {Parameters:
ext:str
Returns: str
Defined at line 208
mime_from_path
MIME type for a path (uses its extension).
pub fn mime_from_path(path: str) -> str {Parameters:
path:str
Returns: str
Defined at line 225
mime_known
True if ext maps to a known type.
pub fn mime_known(ext: str) -> bool {Parameters:
ext:str
Returns: bool
Defined at line 230
mime_ext_for
First extension registered for a MIME type, or "" when none.
pub fn mime_ext_for(mime: str) -> str {Parameters:
mime:str
Returns: str
Defined at line 235
mime_base
Strip parameters: “text/html; charset=utf-8” → “text/html”.
pub fn mime_base(content_type: str) -> str {Parameters:
content_type:str
Returns: str
Defined at line 251
mime_param
A parameter value from a Content-Type header, e.g. mime_param(“text/c; charset=utf-8”, “charset”) → “utf-8”.
pub fn mime_param(content_type: str, name: str) -> str {Parameters:
content_type:strname:str
Returns: str
Defined at line 262
mime_is_text
pub fn mime_is_text(ct: str) -> bool {Parameters:
ct:str
Returns: bool
Defined at line 294
mime_is_image
pub fn mime_is_image(ct: str) -> bool {Parameters:
ct:str
Returns: bool
Defined at line 302
mime_is_audio
pub fn mime_is_audio(ct: str) -> bool {Parameters:
ct:str
Returns: bool
Defined at line 305
mime_is_video
pub fn mime_is_video(ct: str) -> bool {Parameters:
ct:str
Returns: bool
Defined at line 308
mime_is_compressible
True for types that compress well (text + structured data).
pub fn mime_is_compressible(ct: str) -> bool {Parameters:
ct:str
Returns: bool
Defined at line 313
Generated by scribe, the Fides documentation generator