Sunbeam Studios

Our open-source projects, here for you!

mime (0.3.17)

Published 2026-03-26 11:00:24 +00:00 by siennathesane

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add mime@0.3.17

About this package

Strongly Typed Mimes

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

Keywords

mime media-extensions media-types
Details
Cargo
2026-03-26 11:00:24 +00:00
0
Sean McArthur <sean@seanmonstar.com>
MIT OR Apache-2.0
15 KiB
Assets (1)
Versions (1) View all
0.3.17 2026-03-26