tree: b31fb218feb5559e2518f94f995c1b7a60706165 [path history] [tgz]
  1. benches/
  2. src/
  3. .cargo-checksum.json
  4. Cargo.toml
  5. CONTRIBUTING.md
  6. LICENSE-APACHE
  7. LICENSE-MIT
  8. README.md
vendor/mime-0.3.17/README.md

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!
    }
}