#mime #xdg #configuration #parser #linux

xdg-mime

A library for loading and querying the XDG shared MIME database

8 releases

new 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

#100 in Unix APIs

Download history 398/week @ 2024-01-03 534/week @ 2024-01-10 441/week @ 2024-01-17 578/week @ 2024-01-24 552/week @ 2024-01-31 499/week @ 2024-02-07 826/week @ 2024-02-14 838/week @ 2024-02-21 737/week @ 2024-02-28 774/week @ 2024-03-06 987/week @ 2024-03-13 983/week @ 2024-03-20 988/week @ 2024-03-27 898/week @ 2024-04-03 627/week @ 2024-04-10 921/week @ 2024-04-17

3,609 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–1.8MB
~31K SLoC