| Crates.io | mimee |
| lib.rs | mimee |
| version | 0.2.0 |
| created_at | 2025-02-20 11:41:28.597505+00 |
| updated_at | 2025-03-09 17:25:40.196974+00 |
| description | A simple crate for detection of a file's MIME type by its extension. |
| homepage | |
| repository | https://github.com/Alirexaa/mimee |
| max_upload_size | |
| id | 1562563 |
| size | 84,744 |
Mimee is a Rust library that provides a mapping between file extensions and their corresponding MIME types. It allows you to easily determine the MIME type of a file based on its extension.
Add this to your Cargo.toml:
[dependencies]
mimee = "0.2.0"
use mimee::MimeDict;
fn main() {
let mut mime_dict = MimeDict::new();
let content_type = mime_dict.get_content_type("example.txt".to_string());
println!("MIME type: {:?}", content_type);
// Adding a custom MIME type
mime_dict.add(".custom".to_string(), "application/x-custom".to_string());
let custom_content_type = mime_dict.get_content_type("file.custom");
println!("Custom MIME type: {:?}", custom_content_type);
}
This project is licensed under the MIT License