cheep-crator-2/vendor/mime
Nixon Enraght-Moony 842725426c Vendor everything 2022-07-19 12:14:16 +01:00
..
benches Vendor everything 2022-07-19 12:14:16 +01:00
src Vendor everything 2022-07-19 12:14:16 +01:00
.cargo-checksum.json Vendor everything 2022-07-19 12:14:16 +01:00
CONTRIBUTING.md Vendor everything 2022-07-19 12:14:16 +01:00
Cargo.toml Vendor everything 2022-07-19 12:14:16 +01:00
LICENSE-APACHE Vendor everything 2022-07-19 12:14:16 +01:00
LICENSE-MIT Vendor everything 2022-07-19 12:14:16 +01:00
README.md Vendor everything 2022-07-19 12:14:16 +01:00

README.md

mime

Build Status crates.io docs.rs

Support MIME (Media Types) as strong types in Rust.

Documentation

Usage

extern crate mime;

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