Struct MimeType

Source
pub struct MimeType {}

Implementations§

Source§

impl MimeType

Source

pub const APPLICATION_OCTET_STREAM: &'static str = "application/octet-stream"

Source

pub const APPLICATION_ABIWORD: &'static str = "application/x-abiword"

Source

pub const APPLICATION_VND_AMAZON_EBOOK: &'static str = "application/vnd.amazon.ebook"

Source

pub const APPLICATION_X_BZIP: &'static str = "application/x-bzip"

Source

pub const APPLICATION_X_BZIP2: &'static str = "application/x-bzip2"

Source

pub const APPLICATION_X_CDF: &'static str = "application/x-cdf"

Source

pub const APPLICATION_X_CSH: &'static str = "application/x-csh"

Source

pub const APPLICATION_MSWORD: &'static str = "application/msword"

Source

pub const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENTS_WORDPROCESSINGIMPL_DOCUMENT: &'static str = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"

Source

pub const APPLICATION_VND_MS_FONTOBJECT: &'static str = "application/vnd.ms-fontobject"

Source

pub const APPLICATION_EPUB_ZIP: &'static str = "application/epub+zip"

Source

pub const APPLICATION_GZIP: &'static str = "application/gzip"

Source

pub const APPLICATION_JAVA_ARCHIVE: &'static str = "application/java-archive"

Source

pub const APPLICATION_JSON: &'static str = "application/json"

Source

pub const APPLICATION_JSONLD: &'static str = "application/ld+json"

Source

pub const APPLICATION_VND_APPLE_INSTALLER_XML: &'static str = "application/vnd.apple.installer+xml"

Source

pub const APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION: &'static str = "application/vnd.oasis.opendocument.presentation"

Source

pub const APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET: &'static str = "application/vnd.oasis.opendocument.spreadsheet"

Source

pub const APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT: &'static str = "application/vnd.oasis.opendocument.text"

Source

pub const APPLICATION_OGG: &'static str = "application/ogg"

Source

pub const APPLICATION_PDF: &'static str = "application/pdf"

Source

pub const APPLICATION_X_HTTPD_PHP: &'static str = "application/x-httpd-php"

Source

pub const APPLICATION_VND_MS_POWERPOINT: &'static str = "application/vnd.ms-powerpoint"

Source

pub const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_PRESENTATION: &'static str = "application/vnd.openxmlformats-officedocument.presentationml.presentation"

Source

pub const APPLICATION_VND_RAR: &'static str = "application/vnd.rar"

Source

pub const APPLICATION_RTF: &'static str = "application/rtf"

Source

pub const APPLICATION_X_SH: &'static str = "application/x-sh"

Source

pub const APPLICATION_X_SHOCKWAVE_FLASH: &'static str = "application/x-shockwave-flash"

Source

pub const APPLICATION_X_TAR: &'static str = "application/x-tar"

Source

pub const APPLICATION_VND_VISIO: &'static str = "application/vnd.visio"

Source

pub const APPLICATION_XHTML_XML: &'static str = "application/xhtml+xml"

Source

pub const APPLICATION_VND_MS_EXCEL: &'static str = "application/vnd.ms-excel"

Source

pub const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEET: &'static str = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"

Source

pub const APPLICATION_XML: &'static str = "application/xml"

Source

pub const APPLICATION_VND_MOZILLA_XUL_XML: &'static str = "application/vnd.mozilla.xul+xml"

Source

pub const APPLICATION_ZIP: &'static str = "application/zip"

Source

pub const APPLICATION_X_7Z_COMPRESSED: &'static str = "application/x-7z-compressed"

Source

pub const APPLICATION_X_X509_CA_CERT: &'static str = "application/x-x509-ca-cert"

Source

pub const TEXT_PLAIN: &'static str = "text/plain"

Source

pub const TEXT_CSS: &'static str = "text/css"

Source

pub const TEXT_CSV: &'static str = "text/csv"

Source

pub const TEXT_HTML: &'static str = "text/html"

Source

pub const TEXT_JAVASCRIPT: &'static str = "text/javascript"

Source

pub const TEXT_CALENDAR: &'static str = "text/calendar"

Source

pub const IMAGE_APNG: &'static str = "image/apng"

Source

pub const IMAGE_AVIF: &'static str = "image/avif"

Source

pub const IMAGE_GIF: &'static str = "image/gif"

Source

pub const IMAGE_JPEG: &'static str = "image/jpeg"

Source

pub const IMAGE_PNG: &'static str = "image/png"

Source

pub const IMAGE_SVG: &'static str = "image/svg+xml"

Source

pub const IMAGE_WEBP: &'static str = "image/webp"

Source

pub const IMAGE_BMP: &'static str = "image/bmp"

Source

pub const IMAGE_ICO: &'static str = "image/x-icon"

Source

pub const IMAGE_TIFF: &'static str = "image/tiff"

Source

pub const AUDIO_AAC: &'static str = "audio/aac"

Source

pub const AUDIO_FLAC: &'static str = "audio/flac"

Source

pub const AUDIO_WAV: &'static str = "audio/wav"

Source

pub const AUDIO_MP4: &'static str = "audio/mp4"

Source

pub const AUDIO_OGG: &'static str = "audio/oga"

Source

pub const AUDIO_MIDI: &'static str = "audio/midi"

Source

pub const AUDIO_MPEG: &'static str = "audio/mpeg"

Source

pub const AUDIO_OPUS: &'static str = "audio/opus"

Source

pub const AUDIO_WEBM: &'static str = "audio/webm"

Source

pub const VIDEO_3GP: &'static str = "video/3gpp"

Source

pub const VIDEO_MPEG: &'static str = "video/mpeg"

Source

pub const VIDEO_MP4: &'static str = "video/mp4"

Source

pub const VIDEO_OGG: &'static str = "video/ogg"

Source

pub const VIDEO_QUICKTIME: &'static str = "video/quicktime"

Source

pub const VIDEO_WEBM: &'static str = "video/webm"

Source

pub const VIDEO_X_MSVIDEO: &'static str = "video/x-msvideo"

Source

pub const VIDEO_MP2T: &'static str = "video/mp2t"

Source

pub const VIDEO_3GPP2: &'static str = "video/3gpp2"

Source

pub const FONT_OTF: &'static str = "font/otf"

Source

pub const FONT_TTF: &'static str = "font/ttf"

Source

pub const FONT_WOFF: &'static str = "font/woff"

Source

pub const FONT_WOFF2: &'static str = "font/woff2"

Source

pub const TXT_SUFFIX: &'static str = ".txt"

Source

pub const CSS_SUFFIX: &'static str = ".css"

Source

pub const HTML_SUFFIX: &'static str = ".html"

Source

pub const HTM_SUFFIX: &'static str = ".htm"

Source

pub const JS_SUFFIX: &'static str = ".js"

Source

pub const MJS_SUFFIX: &'static str = ".mjs"

Source

pub const APNG_SUFFIX: &'static str = ".apng"

Source

pub const AVIF_SUFFIX: &'static str = ".avif"

Source

pub const GIF_SUFFIX: &'static str = ".gif"

Source

pub const JPG_SUFFIX: &'static str = ".jpg"

Source

pub const JPEG_SUFFIX: &'static str = ".jpeg"

Source

pub const JPE_SUFFIX: &'static str = ".jpe"

Source

pub const JIF_SUFFIX: &'static str = ".jif"

Source

pub const JFIF_SUFFIX: &'static str = ".jfif"

Source

pub const PNG_SUFFIX: &'static str = ".png"

Source

pub const SVG_SUFFIX: &'static str = ".svg"

Source

pub const WEBP_SUFFIX: &'static str = ".webp"

Source

pub const BMP_SUFFIX: &'static str = ".bmp"

Source

pub const ICO_SUFFIX: &'static str = ".ico"

Source

pub const CUR_SUFFIX: &'static str = ".cur"

Source

pub const TIF_SUFFIX: &'static str = ".tif"

Source

pub const TIFF_SUFFIX: &'static str = ".tiff"

Source

pub const AAC_SUFFIX: &'static str = ".aac"

Source

pub const FLAC_SUFFIX: &'static str = ".flac"

Source

pub const WAV_SUFFIX: &'static str = ".wav"

Source

pub const M4A_SUFFIX: &'static str = ".m4a"

Source

pub const N3GP_SUFFIX: &'static str = ".3gp"

Source

pub const MPG_SUFFIX: &'static str = ".mpg"

Source

pub const MPEG_SUFFIX: &'static str = ".mpeg"

Source

pub const MP4_SUFFIX: &'static str = ".mp4"

Source

pub const M4V_SUFFIX: &'static str = ".m4v"

Source

pub const M4P_SUFFIX: &'static str = ".m4p"

Source

pub const OGA_SUFFIX: &'static str = ".oga"

Source

pub const OGG_SUFFIX: &'static str = ".ogg"

Source

pub const OGV_SUFFIX: &'static str = ".ogv"

Source

pub const MOV_SUFFIX: &'static str = ".mov"

Source

pub const WEBM_SUFFIX: &'static str = ".webm"

Source

pub const ABW_SUFFIX: &'static str = ".abw"

Source

pub const AVI_SUFFIX: &'static str = ".avi"

Source

pub const AZV_SUFFIX: &'static str = ".azw"

Source

pub const BIN_SUFFIX: &'static str = ".bin"

Source

pub const BZ_SUFFIX: &'static str = ".bz"

Source

pub const BZ2_SUFFIX: &'static str = ".bz2"

Source

pub const CDA_SUFFIX: &'static str = ".cda"

Source

pub const CSH_SUFFIX: &'static str = ".csh"

Source

pub const CSV_SUFFIX: &'static str = ".csv"

Source

pub const DOC_SUFFIX: &'static str = ".doc"

Source

pub const DOCX_SUFFIX: &'static str = ".docx"

Source

pub const EOT_SUFFIX: &'static str = ".eot"

Source

pub const EPUB_SUFFIX: &'static str = ".epub"

Source

pub const GZ_SUFFIX: &'static str = ".gz"

Source

pub const ICS_SUFFIX: &'static str = ".ics"

Source

pub const JAR_SUFFIX: &'static str = ".jar"

Source

pub const JSON_SUFFIX: &'static str = ".json"

Source

pub const JSONLD_SUFFIX: &'static str = ".jsonld"

Source

pub const MIDI_SUFFIX: &'static str = ".midi"

Source

pub const MID_SUFFIX: &'static str = ".mid"

Source

pub const MP3_SUFFIX: &'static str = ".mp3"

Source

pub const MPKG_SUFFIX: &'static str = ".mpkg"

Source

pub const ODP_SUFFIX: &'static str = ".odp"

Source

pub const ODS_SUFFIX: &'static str = ".ods"

Source

pub const ODT_SUFFIX: &'static str = ".odt"

Source

pub const OGX_SUFFIX: &'static str = ".ogx"

Source

pub const OPUS_SUFFIX: &'static str = ".opus"

Source

pub const OTF_SUFFIX: &'static str = ".otf"

Source

pub const PDF_SUFFIX: &'static str = ".pdf"

Source

pub const PHP_SUFFIX: &'static str = ".php"

Source

pub const PPT_SUFFIX: &'static str = ".ppt"

Source

pub const PPTX_SUFFIX: &'static str = ".pptx"

Source

pub const RAR_SUFFIX: &'static str = ".rar"

Source

pub const RTF_SUFFIX: &'static str = ".rtf"

Source

pub const SH_SUFFIX: &'static str = ".sh"

Source

pub const SWF_SUFFIX: &'static str = ".swf"

Source

pub const TAR_SUFFIX: &'static str = ".tar"

Source

pub const TS_SUFFIX: &'static str = ".ts"

Source

pub const TTF_SUFFIX: &'static str = ".ttf"

Source

pub const VSD_SUFFIX: &'static str = ".vsd"

Source

pub const WEBA_SUFFIX: &'static str = ".weba"

Source

pub const WOFF_SUFFIX: &'static str = ".woff"

Source

pub const WOFF2_SUFFIX: &'static str = ".woff2"

Source

pub const XHTML_SUFFIX: &'static str = ".xhtml"

Source

pub const XLS_SUFFIX: &'static str = ".xls"

Source

pub const XLSX_SUFFIX: &'static str = ".xlsx"

Source

pub const XML_SUFFIX: &'static str = ".xml"

Source

pub const XUL_SUFFIX: &'static str = ".xul"

Source

pub const ZIP_SUFFIX: &'static str = ".zip"

Source

pub const N7Z_SUFFIX: &'static str = ".7z"

Source

pub const N3G2_SUFFIX: &'static str = ".3g2"

Source

pub const CRT_SUFFIX: &'static str = ".crt"

Source

pub fn detect_mime_type(request_uri: &str) -> String

Source

pub fn get_extension_from_filename(filename: &str) -> Option<&str>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.