rust-ipfs/vendor/mime
Vladislav Tsarev 3dec7eeb01 Initial commit
2024-10-18 11:36:33 +03:00
..
benches Initial commit 2024-10-18 11:36:33 +03:00
src Initial commit 2024-10-18 11:36:33 +03:00
.cargo-checksum.json Initial commit 2024-10-18 11:36:33 +03:00
Cargo.toml Initial commit 2024-10-18 11:36:33 +03:00
CONTRIBUTING.md Initial commit 2024-10-18 11:36:33 +03:00
LICENSE-APACHE Initial commit 2024-10-18 11:36:33 +03:00
LICENSE-MIT Initial commit 2024-10-18 11:36:33 +03:00
README.md Initial commit 2024-10-18 11:36:33 +03:00

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