Skip to main content

Backend

Trait Backend 

Source
pub trait Backend: 'static {
    // Required methods
    fn name(&self) -> String;
    fn start(&mut self, spec: &Spec, events: Events) -> Result<(), String>;
    fn set_menu(&mut self, entries: &[Entry]) -> Result<(), String>;
    fn stop(&mut self);
}
Expand description

What shows the tray icon. It lives on the interface thread (the system’s tray objects are tied to it on Windows and macOS).

Required Methods§

Source

fn name(&self) -> String

A short name: sni, windows, macos, simulated.

Source

fn start(&mut self, spec: &Spec, events: Events) -> Result<(), String>

Shows the icon.

Source

fn set_menu(&mut self, entries: &[Entry]) -> Result<(), String>

Shows this menu from now on.

Source

fn stop(&mut self)

Takes the icon away.

Implementors§