pub struct NativeTrayHandle { /* private fields */ }Expand description
Operating-system native desktop system tray controller.
Implementations§
Source§impl NativeTrayHandle
impl NativeTrayHandle
Sourcepub fn new(icon: TrayIcon, event_sink: TrayEventSink) -> Self
pub fn new(icon: TrayIcon, event_sink: TrayEventSink) -> Self
Creates and registers an OS-native system tray icon.
See TrayIcon::spawn_native for the Linux main-thread contract.
Sourcepub fn new_handle_only(icon: TrayIcon, event_sink: TrayEventSink) -> Self
pub fn new_handle_only(icon: TrayIcon, event_sink: TrayEventSink) -> Self
Creates a deterministic handle-only tray controller without attempting OS registration.
Sourcepub fn backend_name(&self) -> &'static str
pub fn backend_name(&self) -> &'static str
Returns the active native backend identifier.
"ayatana-appindicator": Registered via Linux Ayatana AppIndicator"win32-tray": Registered via Windows Shell_NotifyIconW"cocoa-nsstatusbar": Registered via macOS NSStatusBar"handle-only": Fallback in-process controller
Sourcepub fn set_tooltip(&mut self, tooltip: impl Into<String>)
pub fn set_tooltip(&mut self, tooltip: impl Into<String>)
Updates tooltip text on the system tray icon.
Sets or updates the tray context menu.
Sourcepub fn set_visible(&mut self, visible: bool)
pub fn set_visible(&mut self, visible: bool)
Sets visibility of the system tray icon.
Sourcepub fn set_badge(&mut self, badge: Option<String>)
pub fn set_badge(&mut self, badge: Option<String>)
Sets or clears the notification badge on the tray icon.
Sourcepub fn trigger_click(&mut self)
pub fn trigger_click(&mut self)
Dispatches a simulated or native tray icon click event.
Dispatches a simulated or native menu action event.
Auto Trait Implementations§
impl !RefUnwindSafe for NativeTrayHandle
impl !Send for NativeTrayHandle
impl !Sync for NativeTrayHandle
impl !UnwindSafe for NativeTrayHandle
impl Forget for NativeTrayHandle
impl Freeze for NativeTrayHandle
impl Move for NativeTrayHandle
impl Unpin for NativeTrayHandle
impl UnsafeUnpin for NativeTrayHandle
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