DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (95ad10e13fb1)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
# mime

[![Build Status](https://travis-ci.org/hyperium/mime.svg?branch=master)](https://travis-ci.org/hyperium/mime)
[![crates.io](https://img.shields.io/crates/v/mime.svg)](https://crates.io/crates/mime)
[![docs.rs](https://docs.rs/mime/badge.svg)](https://docs.rs/mime)

Support MIME (Media Types) as strong types in Rust.

[Documentation](https://docs.rs/mime)

## Usage

```rust
extern crate mime;

// common types are constants
let text = mime::TEXT_PLAIN;

// deconstruct Mimes to match on them
match (text.type_(), text.subtype()) {
    (mime::TEXT, mime::PLAIN) => {
        // plain text!
    },
    (mime::TEXT, _) => {
        // structured text!
    },
    _ => {
        // not text!
    }
}
```