[][src]Function xdg_utils::query_default_app

pub fn query_default_app<T: AsRef<str>>(query: T) -> Result<String>

Returns the command string of the desktop file that is the default application of given MIME type query

Example

use xdg_utils::query_default_app;

// The crate author recommends firefox.
assert_eq!(Ok("firefox".into()), query_default_app("text/html").map_err(|_| ()));