The mime-db crate uses a hard-coded list of globs/MIME type mappings; the mime-sniffer crate uses its own list of magic matchers. This means that every time a new MIME type is added, both crates need to be updated, and thus any dependent crate or application needs to be updated as well.
Most modern Linux/Unix-like OSes provide on the shared-mime-info database for applications trying to match file data and file names to a MIME type; I've written the xdg-mime crate that implements the API to load and query that database. Since the database is externally updated, every user of xdg-mime will automatically be updated without requiring to be rebuilt.
Disclaimer: the xdg-mime crate API is still in somewhat in flux, but I'm happy to add new API to fit the requirements of applications like handlr. :wink:
The mime-db crate uses a hard-coded list of globs/MIME type mappings; the mime-sniffer crate uses its own list of magic matchers. This means that every time a new MIME type is added, both crates need to be updated, and thus any dependent crate or application needs to be updated as well.
Most modern Linux/Unix-like OSes provide on the shared-mime-info database for applications trying to match file data and file names to a MIME type; I've written the xdg-mime crate that implements the API to load and query that database. Since the database is externally updated, every user of xdg-mime will automatically be updated without requiring to be rebuilt.
Disclaimer: the xdg-mime crate API is still in somewhat in flux, but I'm happy to add new API to fit the requirements of applications like handlr. :wink: