Expand description
use mediatype::{consts::*, MediaType, MediaTypeBuf};

const TEXT_PLAIN: MediaType = MediaType::new(TEXT, PLAIN);
let text_plain: MediaTypeBuf = "text/plain".parse().unwrap();

assert_eq!(text_plain, TEXT_PLAIN);

match (text_plain.ty(), text_plain.subty()) {
   ("text", "plain") => println!("plain text!"),
   ("text", _) => println!("structured text"),
   _ => println!("not text"),
}

Modules

Predefined names.

Structs

A parsed MediaType.

An owned MediaType.

A MediaType name.

An iterator over the parameters.

Enums

Parsing error.