mime_guess

MIME/media-type guessing from file extensions in Rust

Library
Cargo
v2.0.5
221 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
35 /100 Needs Attention
Development Activity 0
Maintenance 0
Community 60
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
65 /100 Good
Architecture 62
Code Quality 65
Innovation 45
Learning Curve 88

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 16 apps in this directory

Python
73%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

40,705

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 73%
TypeScript 12%
Rust 11%
Updated yesterday
Rust
63%
MIT

Readur

Bookmarks Archiving · File Storage · Knowledge Management

804

A self-hosted document management system that OCRs, indexes, and makes every PDF, scan, and Office file instantly searchable.

View details
83
Repo Health
78
Technical
67
Dependency
Built with
Rust 63%
TypeScript 32%
Updated yesterday
TypeScript
61%
AGPL 3.0

Silex

Design Tools · No Code Platforms

3,015

Free, open-source visual website builder that exports clean HTML/CSS — no lock-in, no subscription, host anywhere

View details
89
Repo Health
68
Technical
67
Dependency
Built with
TypeScript 61%
Rust 15%
JavaScript 11%
Updated 2 days ago
Rust
79%
AGPL 3.0

Spacedrive

Collaboration · File Storage

39,292

One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.

View details
84
Repo Health
84
Technical
63
Dependency
Built with
Rust 79%
TypeScript 18%
Updated 1 weeks ago
Rust
66%
Apache 2.0

Temps

Analytics · Devops · Monitoring

865

A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.

View details
81
Repo Health
86
Technical
66
Dependency
Built with
Rust 66%
TypeScript 33%
Updated 2 days ago
Rust
79%
Apache 2.0

TensorZero

Ab Testing Experimentation · AI Development · Monitoring

11,708

TensorZero unifies the LLM gateway, observability, evaluation, optimization, and experimentation stack behind a single OpenAI-compatible API, built in Rust for sub-millisecond p99 latency.

View details
53
Repo Health
87
Technical
68
Dependency
Built with
Rust 79%
TypeScript 15%
Updated 4 months ago
Rust
50%
Apache 2.0

Vibe Kanban

AI Agents · AI Code Assistants · Project Management

28,441

A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.

View details
72
Repo Health
75
Technical
63
Dependency
Built with
Rust 50%
TypeScript 46%
Updated 1 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