1 unstable release
0.0.0 | Jan 29, 2021 |
---|
#25 in #internals
170 downloads per month
Used in 12 crates
(2 directly)
44KB
1K
SLoC
mime
Support MIME (HTTP Media Types) as strong types in Rust.
Usage
extern crate mime;
fn main() {
// 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!
}
}
}
lib.rs
:
Internal types for the mime
crate.
Nothing to see here. Move along.