The mime_more Crate
mime_more is an extension to the mime crate, offering additional functionality for working with MIME types. ⚡️:crab:
Features
- Built on
mime, inheriting all its capabilities. - Extension-Based MIME Guessing:
extensionFeature: Uses themime_guesscrate to guess the MIME type based on file extensions.extension-lightFeature: A lighter version of theextensionfeature, supporting only common extensions. About 8x faster thanextension!
- Magic Byte-Based MIME Guessing (
magicFeature): Uses theinfercrate to determine MIME type based on file magic bytes. - Texture Validation (
textureFeature): Provides high-performance methods for texture validation. - Data URL Generation (
dataurlFeature): Generates and parses data URLs with relatively shorter lengths and less time. It encodesSource Han Sansfont in about 1.5 ms and decodes it in about 6 ms!
Usage
Add mime_more to your Cargo.toml:
[]
= "0.1.4"
Example usage:
Directly Parsing MIME Types
use Mime;
Guessing MIME Types via File Path
Needs
extension(function is namedfrom_path) orextension-light(function is namedfrom_path_light) feature.
use Mime;
Inferring MIME Types via File Magic Bytes
Needs
magicfeature.
use Mime;
Validating Textures
Needs
texturefeature.
use Mime;
Generating Data URLs
Needs
dataurlfeature.
use ;
License
This project is licensed under the MIT license.
Authors
The project is currently developed by Ethan Goh.