#config #xdg #mime-types #linux #mime

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

#337 in Unix APIs

Download history 592/week @ 2024-12-21 606/week @ 2024-12-28 918/week @ 2025-01-04 1103/week @ 2025-01-11 1036/week @ 2025-01-18 697/week @ 2025-01-25 935/week @ 2025-02-01 912/week @ 2025-02-08 1022/week @ 2025-02-15 1153/week @ 2025-02-22 1151/week @ 2025-03-01 912/week @ 2025-03-08 633/week @ 2025-03-15 651/week @ 2025-03-22 267/week @ 2025-03-29 165/week @ 2025-04-05

1,855 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