Skip to main content

mime_from_ext

Function mime_from_ext 

Source
pub fn mime_from_ext(ext: &str) -> &'static str
Expand description

Map a file extension to its MIME type string.

Used by the asset!() macro to infer content-type from the path extension. Unknown extensions return "application/octet-stream", preserving byte-identical passthrough for unrecognized file types (SC #2). Input is expected lowercase (e.g. from Path::extension); matching is exact.