https://github.com/ebassi/xdg-mime-rs
Rust crate for querying the shared-mime-info database
https://github.com/ebassi/xdg-mime-rs
freedesktop mime-types rust rust-crate xdg
Last synced: 8 months ago
JSON representation
Rust crate for querying the shared-mime-info database
- Host: GitHub
- URL: https://github.com/ebassi/xdg-mime-rs
- Owner: ebassi
- License: apache-2.0
- Created: 2020-05-10T14:38:18.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-08-11T13:50:50.000Z (10 months ago)
- Last Synced: 2025-09-19T15:58:27.966Z (9 months ago)
- Topics: freedesktop, mime-types, rust, rust-crate, xdg
- Language: Rust
- Size: 231 KB
- Stars: 17
- Watchers: 1
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://crates.io/crates/xdg-mime)
[](https://docs.rs/xdg-mime)

xdg-mime-rs
===========
Xdg-mime-rs is a library that parses the [shared-mime-info][shared-mime]
database and allows querying it to determine the MIME type of a file from
its extension or from its contents.
Xdg-mime-rs is a complete re-implementation of the [xdgmime][xdgmime] C
library, with some added functionality that typically resides in higher
level components, like determining the appropriate icon name for a file
from the [icon theme][fdo-icon-theme].
[Documentation][docs].
Installation
------------
Add the following to your `Cargo.toml` file:
```toml
[dependencies]
xdg-mime = "^0.4"
```
or install [`cargo-edit`][cargo-edit] and call:
```
cargo add xdg-mime@0.4
```
Copyright and license
---------------------
Copyright 2020 Emmanuele Bassi
This software is distributed under the terms of the [Apache License
version 2.0](./LICENSE.txt).
[shared-mime]: https://freedesktop.org/wiki/Specifications/shared-mime-info-spec/
[xdgmime]: https://gitlab.freedesktop.org/xdg/xdgmime
[fdo-icon-theme]: https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
[cargo-edit]: https://github.com/killercup/cargo-edit
[docs]: https://docs.rs/xdg_mime/