| # mime |
| |
| [](https://travis-ci.org/hyperium/mime) |
| [](https://crates.io/crates/mime) |
| [](https://docs.rs/mime) |
| |
| Support MIME (Media Types) as strong types in Rust. |
| |
| [Documentation](https://docs.rs/mime) |
| |
| ## Usage |
| |
| ```rust |
| 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! |
| } |
| } |
| ``` |