Trait fif::mime_db::MimeDb

source ·
pub trait MimeDb {
    // Required methods
    fn init() -> Self;
    fn get_type(&self, data: &[u8]) -> Option<Mime>;
}
Expand description

A thin wrapper around either Infer or xdg-mime::SharedMimeInfo, depending on which cargo features fif was compiled with. By default, fif uses an Infer-based implementation on Windows, and an xdg-mime-based one everywhere else. This behaviour can be changed at compile time by using the aforementioned cargo features.

Required Methods§

source

fn init() -> Self

Initialise the database.

source

fn get_type(&self, data: &[u8]) -> Option<Mime>

Given a slice of bytes, returns the inferred MIME type, if any.

Object Safety§

This trait is not object safe.

Implementors§