Macro rocket::http::hyper::mime::mime

source ·
macro_rules! mime {
    ($top:tt / $sub:tt) => { ... };
    ($top:tt / $sub:tt ; $($attr:tt = $val:tt),*) => { ... };
}
Expand description

Easily create a Mime without having to import so many enums.

§Example


let json = mime!(Application/Json);
let plain = mime!(Text/Plain; Charset=Utf8);
let text = mime!(Text/Html; Charset=("bar"), ("baz")=("quux"));
let img = mime!(Image/_);