pub struct ApplicationService {
pub on_apps_refreshed: Event<()>,
/* private fields */
}Expand description
A service to access desktop applications.
Fields§
§on_apps_refreshed: Event<()>Emitted when the list of installed applications changed.
This can occur, for example, when an application is installed or removed from the system.
Implementations§
Source§impl ApplicationService
impl ApplicationService
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new instance.
It loads all application entries from XDG_DATA_DIRS and gets the system locale.
Sourcepub fn watch(&self) -> Result<()>
pub fn watch(&self) -> Result<()>
Starts watching for changes in application entries. Re-initializes apps if a change occurs.
§Errors
Error::NotifyError
Sourcepub fn apps(&self) -> Vec<DesktopAppHandle>
pub fn apps(&self) -> Vec<DesktopAppHandle>
Returns a list of applications.
Sourcepub fn app_by_id(&self, app_id: &str) -> Option<DesktopAppHandle>
pub fn app_by_id(&self, app_id: &str) -> Option<DesktopAppHandle>
Returns an application by its ID, or None if it is not found.
Sourcepub fn search_by_name(&self, query: &str) -> Vec<DesktopAppHandle>
pub fn search_by_name(&self, query: &str) -> Vec<DesktopAppHandle>
Fuzzily search through the application entries by provided application name.
Trait Implementations§
Source§impl Clone for ApplicationService
impl Clone for ApplicationService
Source§fn clone(&self) -> ApplicationService
fn clone(&self) -> ApplicationService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ApplicationService
impl RefUnwindSafe for ApplicationService
impl Send for ApplicationService
impl Sync for ApplicationService
impl Unpin for ApplicationService
impl UnsafeUnpin for ApplicationService
impl UnwindSafe for ApplicationService
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