hyperium/mime

MIMEs in Rust

Rust

223

223 commits

updated Oct 31, 2024

See the code

README

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!
        }
    }
}

Significant stargazers

Clar Fon

71 followers · starred Feb 2017

Christoph Wurst

290 followers · starred Apr 2018

pyfisch

49 followers · starred Dec 2014

Florian Jacob

39 followers · starred Sep 2015

hyperium/mime

MIMEs in Rust

Rust

223

223 commits

updated Oct 31, 2024

See the code

README

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!
        }
    }
}

Significant stargazers

Clar Fon

71 followers · starred Feb 2017

Christoph Wurst

290 followers · starred Apr 2018

pyfisch

49 followers · starred Dec 2014

Florian Jacob

39 followers · starred Sep 2015