Crate mime_type

Crate mime_type 

Source
Expand description

MIME type definitions and conversions for Rust.

This crate provides type-safe MIME type handling with support for converting between file extensions and MIME type strings.

§Examples

use mime_type::{MimeType, MimeFormat};

// Get MIME type from file extension
let mime = MimeType::from_ext("png").unwrap();
assert_eq!(mime.to_string(), "image/png");

// Get MIME type from MIME string
let mime = MimeType::from_mime("video/mp4").unwrap();

Enums§

Application
Application and executable file formats.
Archive
Archive and compressed file formats.
Audio
Audio file formats.
Book
E-book file formats.
Document
Document file formats.
Font
Font file formats.
Image
Image file formats.
MimeType
Main MIME type enum containing all supported categories.
Video
Video file formats.

Traits§

MimeFormat
Trait for converting between file extensions, MIME strings, and MIME types.