Trait Backend
Source pub trait Backend:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> String;
fn probe(&self) -> Result<String, String>;
fn show(
&self,
id: u64,
n: &Notification,
respond: Box<dyn FnOnce(String) + Send>,
) -> Result<(), String>;
// Provided method
fn known(&self) -> Option<Result<String, String>> { ... }
}
Expand description
What shows notifications on the desktop. Desktop is the real
one; Simulated records them, for tests and the gallery.
A short name: xdg, windows, macos, simulated.
Whether the desktop can show notifications, and through what
(the server’s name), or why not. May block: called from a thread.
Shows one. respond gets the action the user picks (an action’s
id, or default for its body), at most once. May block: called
from a thread.
Backend::probe’s answer when it is known without asking
(taken at connect, and the thread asks nothing).