#config #xdg #mime #linux

xdg-mime

A library for loading and querying the XDG shared MIME database

8 releases

0.4.0 Apr 19, 2024
0.3.3 Apr 19, 2021
0.3.2 Jun 14, 2020
0.3.0 May 23, 2020
0.1.0 May 13, 2020

#284 in Unix APIs

Download history 318/week @ 2024-12-09 581/week @ 2024-12-16 615/week @ 2024-12-23 594/week @ 2024-12-30 1051/week @ 2025-01-06 1129/week @ 2025-01-13 921/week @ 2025-01-20 699/week @ 2025-01-27 1061/week @ 2025-02-03 763/week @ 2025-02-10 1278/week @ 2025-02-17 978/week @ 2025-02-24 1167/week @ 2025-03-03 811/week @ 2025-03-10 630/week @ 2025-03-17 497/week @ 2025-03-24

3,231 downloads per month
Used in 5 crates

Apache-2.0

105KB
2K SLoC

crates.io docs.rs Build

xdg-mime-rs

Xdg-mime-rs is a library that parses the shared-mime-info 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 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.

Documentation.

Installation

Add the following to your Cargo.toml file:

[dependencies]
xdg-mime = "^0.3"

or install cargo-edit and call:

cargo add xdg-mime@0.3

Copyright 2020 Emmanuele Bassi

This software is distributed under the terms of the Apache License version 2.0.

Dependencies

~1–1.7MB
~29K SLoC