Skip to main content

Crate mediatypes

Crate mediatypes 

Source
Expand description

§mediatypes

A comprehensive collection of MIME types (media types) as string constants.

This crate provides an organized, hierarchical structure of all standard MIME types registered with IANA, making it easy to reference media types in a type-safe manner.

§Usage

use mediatypes::application::X_WWW_FORM_URLENCODED;
use mediatypes::image::PNG;
use mediatypes::text::HTML;

assert_eq!(X_WWW_FORM_URLENCODED, "application/x-www-form-urlencoded");
assert_eq!(PNG, "image/png");
assert_eq!(HTML, "text/html");

§Organization

MIME types are organized by their top-level type:

  • application - Application-specific data
  • audio - Audio data
  • chemical - Chemical data and molecular structures
  • font - Font data
  • image - Image data
  • message - Message protocol data
  • model - 3D model data
  • multipart - Multi-part data
  • text - Human-readable text
  • video - Video data
  • x_conference - Conference-related experimental types
  • x_shader - Shader-related experimental types

Modules§

application
Application-specific MIME types Application MIME types
audio
Audio MIME types Audio MIME types
chemical
Chemical MIME types Chemical MIME types
font
Font MIME types Font MIME types
image
Image MIME types Image MIME types
message
Message protocol MIME types Message MIME types
model
3D model MIME types Model MIME types
multipart
Multi-part MIME types Multipart MIME types
text
Text MIME types Text MIME types
video
Video MIME types Video MIME types
x_conference
Conference-related experimental MIME types X-conference MIME types
x_shader
Shader-related experimental MIME types X-shader MIME types