MediaType
MIME Media-type parsing for Rust
This crate provides two MediaType structs:
MediaType
and
MediaTypeBuf
.
MediaType
does not copy data during parsing and just holds reference to the original string. It is also const-constructible.MediaTypeBuf
is an owned and immutable version ofMediaType
.
use ;
const TEXT_PLAIN: MediaType = new;
let text_plain: MediaTypeBuf = "text/plain".parse.unwrap;
assert_eq!;
match