Struct tauri::SystemTrayHandle
source · pub struct SystemTrayHandle<R: Runtime = Wry> { /* private fields */ }
Available on crate feature
system-tray
only.Expand description
A handle to a system tray. Allows updating the context menu items.
Implementations§
source§impl<R: Runtime> SystemTrayHandle<R>
impl<R: Runtime> SystemTrayHandle<R>
sourcepub fn get_item(&self, id: MenuIdRef<'_>) -> SystemTrayMenuItemHandle<R>
pub fn get_item(&self, id: MenuIdRef<'_>) -> SystemTrayMenuItemHandle<R>
Gets a handle to the menu item that has the specified id
.
sourcepub fn try_get_item(
&self,
id: MenuIdRef<'_>
) -> Option<SystemTrayMenuItemHandle<R>>
pub fn try_get_item( &self, id: MenuIdRef<'_> ) -> Option<SystemTrayMenuItemHandle<R>>
Attempts to get a handle to the menu item that has the specified id
, return an error if id
is not found.
Updates the tray menu.
sourcepub fn set_tooltip(&self, tooltip: &str) -> Result<()>
pub fn set_tooltip(&self, tooltip: &str) -> Result<()>
Trait Implementations§
source§impl<R: Runtime> Clone for SystemTrayHandle<R>
impl<R: Runtime> Clone for SystemTrayHandle<R>
Auto Trait Implementations§
impl<R> RefUnwindSafe for SystemTrayHandle<R>where <R as Runtime<EventLoopMessage>>::TrayHandler: RefUnwindSafe,
impl<R> Send for SystemTrayHandle<R>
impl<R> Sync for SystemTrayHandle<R>
impl<R> Unpin for SystemTrayHandle<R>where <R as Runtime<EventLoopMessage>>::TrayHandler: Unpin,
impl<R> UnwindSafe for SystemTrayHandle<R>where <R as Runtime<EventLoopMessage>>::TrayHandler: UnwindSafe,
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