rocket::http::hyper::mime

Macro 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/_);