pub struct UrlHandlerApp {
pub appid: String,
pub name: String,
pub comment: Option<String>,
pub icon: IconSource,
pub path: PathBuf,
}Expand description
Represents an application that can handle specific URL schemes.
Fields§
§appid: String§name: String§comment: Option<String>§icon: IconSource§path: PathBufImplementations§
Source§impl UrlHandlerApp
impl UrlHandlerApp
Sourcepub fn handlers_for_scheme(
scheme: &str,
locales: Option<Vec<String>>,
search_paths: Option<Vec<PathBuf>>,
) -> Result<Vec<Self>>
pub fn handlers_for_scheme( scheme: &str, locales: Option<Vec<String>>, search_paths: Option<Vec<PathBuf>>, ) -> Result<Vec<Self>>
Retrieves all applications that can handle the specified URL scheme.
§Arguments
scheme- The URL scheme to query (e.g., “http”, “mailto”).locales- Optional list of locales for localization. IfNone, it fetches the system’s default locales.search_paths- Optional list of paths to search for desktop entries. IfNone, it uses the default XDG paths.
Sourcepub fn from_desktop_entry<L: AsRef<str>>(
de: DesktopEntry,
locales: &[L],
) -> Self
pub fn from_desktop_entry<L: AsRef<str>>( de: DesktopEntry, locales: &[L], ) -> Self
Creates an [App] instance from a freedesktop_desktop_entry::DesktopEntry.
§Arguments
de- The desktop entry to convert.locales- Used for localizing the app’s name and comment.
pub fn icon_path(&self, icon_size: u16) -> Option<PathBuf>
Trait Implementations§
Source§impl Clone for UrlHandlerApp
impl Clone for UrlHandlerApp
Source§fn clone(&self) -> UrlHandlerApp
fn clone(&self) -> UrlHandlerApp
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for UrlHandlerApp
impl RefUnwindSafe for UrlHandlerApp
impl Send for UrlHandlerApp
impl Sync for UrlHandlerApp
impl Unpin for UrlHandlerApp
impl UnwindSafe for UrlHandlerApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more