MCPcopy Index your code
hub / github.com/abonander/mime_guess

github.com/abonander/mime_guess @1.8.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.8.0 ↗ · + Follow
24 symbols 37 edges 4 files 11 documented · 46%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

mime_guess Build Status Crates.io

MIME/MediaType guessing by file extension. Uses a compile-time perfect hash map of known file extension -> MIME type mappings.

Contributing

Adding or correcting MIME types for extensions

Is the MIME type for a file extension wrong or missing? Great! Well, not great for us, but great for you if you'd like to open a pull request!

The file extension -> MIME type mappings are listed in src/mime_types.rs. The list is sorted alphabetically by file extension, and all extensions are lowercase (where applicable). This is necessary only for the sanity of the crate maintainers; extension search is case-insensitive.

Simply add or update the appropriate string pair(s) to make the correction(s) needed. Run cargo test to make sure the library continues to work correctly.

(Important!) Citing the corrected MIME type

When opening a pull request, please include a link to an official document or RFC noting the correct MIME type for the file type in question. Though we're only guessing here, we like to be as correct as we can. It makes it much easier to vet your contribution if we don't have to search for corroborating material.

Changes to the API or operation of the crate

We're open to changes to the crate's API or its inner workings, breaking or not, if it improves the overall operation, efficiency, or ergonomics of the crate. However, it would be a good idea to open an issue on the repository so we can discuss your proposed changes and decide how best to approach them.

License

MIT (See the LICENSE file in this repository for more information.)

Core symbols most depended-on inside this repo

get_mime_type_str
called by 3
src/lib.rs
get_mime_type_opt
called by 2
src/lib.rs
get_extensions
called by 2
src/lib.rs
print_exts
called by 2
examples/rev_map.rs
guess_mime_type_opt
called by 1
src/lib.rs
map_lookup
called by 1
src/lib.rs
build_forward_map
called by 1
src/gen_mime_types.rs
build_rev_map
called by 1
src/gen_mime_types.rs

Shape

Function 23
Class 1

Languages

Rust100%

Modules by API surface

src/lib.rs18 symbols
src/gen_mime_types.rs4 symbols
examples/rev_map.rs2 symbols

For agents

$ claude mcp add mime_guess \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page