Skip to content

82marbag/mime

This branch is 1 commit behind hyperium/mime:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

938484d · Dec 16, 2019
Jan 17, 2019
Jan 15, 2019
Dec 16, 2019
Dec 16, 2019
Aug 27, 2014
Jan 12, 2019
Dec 28, 2018
Jan 17, 2019
Dec 28, 2018
Jan 15, 2019

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%