1 unstable release

0.0.0 Jan 29, 2021

#24 in #internals

Download history 26/week @ 2023-12-01 28/week @ 2023-12-08 29/week @ 2023-12-15 44/week @ 2023-12-22 13/week @ 2023-12-29 31/week @ 2024-01-05 89/week @ 2024-01-12 33/week @ 2024-01-19 28/week @ 2024-01-26 33/week @ 2024-02-02 55/week @ 2024-02-09 54/week @ 2024-02-16 54/week @ 2024-02-23 64/week @ 2024-03-01 64/week @ 2024-03-08 60/week @ 2024-03-15

254 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