1 unstable release

0.0.0 Jan 29, 2021

#24 in #internals

Download history 33/week @ 2024-07-27 37/week @ 2024-08-03 21/week @ 2024-08-10 15/week @ 2024-08-17 25/week @ 2024-08-24 21/week @ 2024-08-31 10/week @ 2024-09-07 19/week @ 2024-09-14 36/week @ 2024-09-21 27/week @ 2024-09-28 2/week @ 2024-10-05 9/week @ 2024-10-12 12/week @ 2024-10-19 12/week @ 2024-10-26 22/week @ 2024-11-02 9/week @ 2024-11-09

55 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