1 unstable release

0.0.0 Jan 29, 2021

#25 in #internals

Download history 57/week @ 2024-03-11 68/week @ 2024-03-18 60/week @ 2024-03-25 86/week @ 2024-04-01 70/week @ 2024-04-08 50/week @ 2024-04-15 34/week @ 2024-04-22 54/week @ 2024-04-29 42/week @ 2024-05-06 56/week @ 2024-05-13 63/week @ 2024-05-20 33/week @ 2024-05-27 38/week @ 2024-06-03 43/week @ 2024-06-10 45/week @ 2024-06-17 43/week @ 2024-06-24

170 downloads per month
Used in 12 crates (2 directly)

MIT license

44KB
1K SLoC

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