mime 0.3.15

Strongly Typed Mimes
docs.rs failed to build mime-0.3.15
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: mime-0.3.17

mime

Build Status crates.io docs.rs

Support MIME (Media Types) as strong types in Rust.

Documentation

Usage

extern crate mime;

// common types are constants
let text = mime::TEXT_PLAIN;

// deconstruct Mimes to match on them
match (text.type_(), text.subtype()) {
    (mime::TEXT, mime::PLAIN) => {
        // plain text!
    },
    (mime::TEXT, _) => {
        // structured text!
    },
    _ => {
        // not text!
    }
}