1 unstable release

0.1.0 Apr 27, 2021

#9 in #internals

Download history 24/week @ 2024-01-01 25/week @ 2024-01-15 46/week @ 2024-01-22 5/week @ 2024-01-29 23/week @ 2024-02-05 94/week @ 2024-02-12 235/week @ 2024-02-19 114/week @ 2024-02-26 118/week @ 2024-03-04 124/week @ 2024-03-11 466/week @ 2024-03-18

823 downloads per month
Used in 3 crates (2 directly)

MIT license

44KB
1K SLoC

Based on the apparently unmaintained mime crate

mime

Build Status crates.io docs.rs

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

Documentation

Usage

extern crate mime;

fn main() {
    // 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!
        }
    }
}

lib.rs:

Internal types for the mime crate.

Nothing to see here. Move along.

No runtime deps