Enum fire_http_representation::header::Mime
source · [−]#[non_exhaustive]
pub enum Mime {
Show 41 variants
Text,
Html,
Js,
Css,
Json,
Csv,
Doc,
Docx,
Pdf,
Php,
Rtf,
Sh,
Vsd,
Xml,
Jpg,
Png,
Gif,
Svg,
Ico,
Tiff,
Webp,
Eot,
Ttf,
Woff,
Woff2,
Avi,
Ogv,
Webm,
Mp4,
Aac,
Mp3,
Oga,
Wav,
Weba,
Rar,
Tar,
Zip,
_7Zip,
Jar,
Binary,
Wasm,
}
Expand description
A list of the most important mime types.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Text
File extension: txt
, mime type: text/plain
Html
File extension: html
, mime type: text/html
Js
File extension: js
, mime type: application/javascript
Css
File extension: css
, mime type: text/css
Json
File extension: json
, mime type: application/json
Csv
File extension: csv
, mime type: text/csv
Doc
File extension: doc
, mime type: application/msword
Docx
File extension: docx
, mime type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Pdf
File extension: pdf
, mime type: application/pdf
Php
File extension: php
, mime type: application/php
Rtf
File extension: rtf
, mime type: application/rtf
Sh
File extension: sh
, mime type: application/x-sh
Vsd
File extension: vsd
, mime type: application/vnd.visio
Xml
File extension: xml
, mime type: text/xml
Jpg
File extension: jpg
, mime type: image/jpeg
Png
File extension: png
, mime type: image/png
Gif
File extension: gif
, mime type: image/gif
Svg
File extension: svg
, mime type: image/svg+xml
Ico
File extension: ico
, mime type: image/vnd.microsoft.icon
Tiff
File extension: tiff
, mime type: image/tiff
Webp
File extension: webp
, mime type: image/webp
Eot
File extension: eot
, mime type: application/vnd.ms-fontobject
Ttf
File extension: ttf
, mime type: font/ttf
Woff
File extension: woff
, mime type: font/woff
Woff2
File extension: woff2
, mime type: font/woff2
Avi
File extension: avi
, mime type: video/x-msvideo
Ogv
File extension: ogv
, mime type: video/ogg
Webm
File extension: webm
, mime type: video/webm
Mp4
File extension: mp4
, mime type: video/mp4
Aac
File extension: aac
, mime type: audio/aac
Mp3
File extension: mp3
, mime type: audio/mpeg
Oga
File extension: oga
, mime type: audio/ogg
Wav
File extension: wav
, mime type: audio/wav
Weba
File extension: weba
, mime type: audio/webm
Rar
File extension: rar
, mime type: application/vnd.rar
Tar
File extension: tar
, mime type: application/x-tar
Zip
File extension: zip
, mime type: application/zip
_7Zip
File extension: 7z
, mime type: application/x-7z-compressed
Jar
File extension: jar
, mime type: application/java-archive
Binary
File extension: bin
, mime type: application/octet-stream
Wasm
File extension: wasm
, mime type: application/wasm
Implementations
sourceimpl Mime
impl Mime
sourcepub fn try_from_ext(value: &str) -> Option<Self>
pub fn try_from_ext(value: &str) -> Option<Self>
Tries to return a mime type from a file extension.
sourcepub fn from_ext(value: &str) -> Self
pub fn from_ext(value: &str) -> Self
Returns a mime type to a given file extension,
if the file extension is unknown Mime::Binary
is returned.
sourcepub fn try_from_mime(value: &str) -> Option<Self>
pub fn try_from_mime(value: &str) -> Option<Self>
Tries to return a mime type from a mime type string.
Trait Implementations
impl Copy for Mime
impl Eq for Mime
impl StructuralEq for Mime
impl StructuralPartialEq for Mime
Auto Trait Implementations
impl RefUnwindSafe for Mime
impl Send for Mime
impl Sync for Mime
impl Unpin for Mime
impl UnwindSafe for Mime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more