|
3 years ago | |
---|---|---|
.. | ||
benches | 3 years ago | |
src | 3 years ago | |
.cargo-checksum.json | 3 years ago | |
CONTRIBUTING.md | 3 years ago | |
Cargo.toml | 3 years ago | |
LICENSE-APACHE | 3 years ago | |
LICENSE-MIT | 3 years ago | |
README.md | 3 years ago |
Support MIME (Media Types) as strong types in 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!
}
}