mime

Crates.iomime
lib.rsmime
version0.3.17
sourcesrc
created_at2014-11-20 08:33:46.22482
updated_at2023-03-20 15:05:04.272177
descriptionStrongly Typed Mimes
homepage
repositoryhttps://github.com/hyperium/mime
max_upload_size
id121
size57,459
Sean McArthur (seanmonstar)

documentation

https://docs.rs/mime

README

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!
    }
}
Commit count: 232

cargo fmt