mirror of
https://github.com/openharmony/third_party_rust_mime.git
synced 2026-06-29 15:42:16 -04:00
master
Merge pull request !2 from peizhe/master
mime
Support MIME (Media Types) as strong types in Rust.
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!
}
}
Description
Languages
Rust
100%