```rust use mediatype::{consts::*, MediaType, MediaTypeBuf};
const TEXTPLAIN: MediaType = MediaType::new(TEXT, PLAIN); let textplain: MediaTypeBuf = "text/plain".parse().unwrap();
asserteq!(textplain, TEXT_PLAIN);
match (textplain.ty(), textplain.subty()) { ("text", "plain") => println!("plain text!"), ("text", _) => println!("structured text"), _ => println!("not text"), } ```