Snap for 12349386 from 503c4fdb9800b3ef2aa63eda7d8a0333906bc916 to sdk-release

Change-Id: Ica7ab0568ba6625c28ec1388e5005869f2fbded0
tree: 652d027ccf2b62b84f6b5416a61fb5ff04a83153
  1. benches/
  2. src/
  3. Android.bp
  4. Cargo.toml
  5. Cargo.toml.orig
  6. CONTRIBUTING.md
  7. LICENSE-APACHE
  8. LICENSE-MIT
  9. METADATA
  10. MODULE_LICENSE_APACHE2
  11. OWNERS
  12. README.md
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!
    }
}