• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

benches/H03-May-2022-9778

src/H03-May-2022-1,302980

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D07-Jan-202074 65

.gitignoreH A D15-Dec-201420 32

.travis.ymlH A D09-Sep-2019346 2118

CONTRIBUTING.mdH A D09-Sep-2019498 137

Cargo.tomlH A D07-Jan-2020841 2421

Cargo.toml.orig-cargoH A D07-Jan-2020352 1310

LICENSE-APACHEH A D09-Sep-201910.6 KiB202169

LICENSE-MITH A D09-Sep-20191 KiB2116

README.mdH A D09-Sep-2019710 3224

README.md

1# mime
2
3[![Build Status](https://travis-ci.org/hyperium/mime.svg?branch=master)](https://travis-ci.org/hyperium/mime)
4[![crates.io](https://img.shields.io/crates/v/mime.svg)](https://crates.io/crates/mime)
5[![docs.rs](https://docs.rs/mime/badge.svg)](https://docs.rs/mime)
6
7Support MIME (Media Types) as strong types in Rust.
8
9[Documentation](https://docs.rs/mime)
10
11## Usage
12
13```rust
14extern crate mime;
15
16// common types are constants
17let text = mime::TEXT_PLAIN;
18
19// deconstruct Mimes to match on them
20match (text.type_(), text.subtype()) {
21    (mime::TEXT, mime::PLAIN) => {
22        // plain text!
23    },
24    (mime::TEXT, _) => {
25        // structured text!
26    },
27    _ => {
28        // not text!
29    }
30}
31```
32