mime_guess

MIME/media-type guessing from file extensions in Rust

Library
Cargo
v2.0.5
220stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
35/100Needs Attention
Development Activity0
Maintenance0
Community60
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
65/100Good
Architecture62
Code Quality65
Innovation45
Learning Curve88

mime_guess is a small Rust crate that maps file extensions to MIME types using a static, compiled-in lookup table, so you can determine a plausible Content-Type for a file without inspecting its bytes. It builds on the mime crate for the returned type representation and optionally generates reverse mappings (MIME type back to known extensions) via the rev-mappings feature.

Because the mapping table itself is not considered part of the crate’s stable API — entries are corrected and expanded even in patch releases — mime_guess is meant for best-effort guessing (HTTP responses, file uploads, static file servers) rather than as an authoritative or exhaustive MIME registry.

What You Get

  • Extension-to-MIME-type lookup via a static table covering a large set of common file extensions
  • Optional reverse lookup (MIME type to extensions) behind the default-on rev-mappings feature
  • Interop with the mime crate so returned values are typed Mime instances, not raw strings
  • A version table in the README pinning mime_guess major versions to compatible mime crate versions
  • Case-insensitive extension matching via the unicase crate

Common Use Cases

  • Setting the Content-Type header for a static file server or HTTP file-download response based on the requested path’s extension
  • Guessing a MIME type for an uploaded file before further validation or content-based sniffing
  • Populating multipart form-data Content-Type fields when building HTTP clients that send files
  • Filtering or categorizing files in a CLI/tooling context by their likely MIME type

Under The Hood

Architecture - the crate is a thin, single-purpose lookup layer: src/mime_types.rs holds the generated extension-to-MIME static data, src/impl_bin_search.rs provides a binary-search-based lookup implementation over that table, and src/lib.rs exposes the public from_ext/from_path-style functions on top; a build.rs script assists in generating parts of the table at build time. Tech Stack - pure Rust with two runtime dependencies (mime for the returned type representation, unicase for case-insensitive extension matching) and criterion for benchmarking lookup performance in benches/. Code Quality - the crate includes a benchmark suite (benches/benchmark.rs) validating that binary-search lookups stay fast, and an examples/rev_map.rs demonstrating the reverse-mapping feature, though the project has had no commits in roughly a year and no tagged releases beyond 2.0.5, putting it in low/maintenance-only activity. API Design - the public surface is intentionally minimal (extension in, Mime out, plus an optional reverse lookup), which keeps the learning curve close to zero, but the README explicitly warns that the specific MIME type returned for a given extension is not a stable API guarantee and can change in patch releases — an unusual caveat consumers should account for if they need deterministic output across versions.

Used by 13 apps in this directory

Dart
74%
AGPL 3.0

AppFlowy

Productivity · Project Management · Collaboration

75,729

The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.

View details
66
Repo Health
81
Technical
66
Dependency
Built with
Dart74%
Rust24%
Updated 1 weeks ago
Rust
86%
Other

Arroyo

Data Engineering · Analytics

5,005

A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.

View details
86
Repo Health
74
Technical
62
Dependency
Built with
Rust86%
Updated 1 weeks ago
Go
59%
Apache 2.0

Cog

AI Development · Devops · Developer Tools

9,459

An open-source CLI that packages machine learning models into standard, production-ready Docker containers — no Dockerfile wrangling, no CUDA version hell.

View details
91
Repo Health
88
Technical
70
Dependency
Built with
Go59%
Rust16%
HTML13%
Updated today
Rust
66%
Other

DefGuard

Security · Networking · Authentication

2,805

Self-hosted secure remote access that unifies WireGuard VPN, identity management, and connection-level MFA in one open-source platform.

View details
85
Repo Health
82
Technical
77
Dependency
Built with
Rust66%
TypeScript32%
Updated today
TypeScript
67%
MIT

Hoppscotch

Developer Tools

80,055

A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.

View details
91
Repo Health
83
Technical
66
Dependency
Built with
TypeScript67%
Vue23%
Updated 3 days ago
Rust
72%
Other

iii

Developer Tools · Devops

18,604

Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.

View details
86
Repo Health
85
Technical
69
Dependency
Built with
Rust72%
TypeScript17%
Updated yesterday
TypeScript
76%
Other

Joplin

Note Taking

56,003

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
62
Dependency
Built with
TypeScript76%
JavaScript15%
Updated yesterday
Rust
78%
AGPL 3.0

Lemmy

Community · Social Media

14,555

Federated, self-hosted Reddit alternative with full community ownership and no corporate control.

View details
90
Repo Health
74
Technical
63
Dependency
Built with
Rust78%
PLpgSQL14%
Updated yesterday
Rust
43%
BSD 3

MicroBin

File Storage

4,525

A self-contained, encrypted paste bin and file-sharing app in Rust with animal-name URLs, burn-after-read, and one-command Docker deployment.

View details
56
Repo Health
67
Technical
71
Dependency
Built with
Rust43%
HTML28%
JavaScript20%
Updated 2 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search