pub struct SystemNotifier { /* private fields */ }Expand description
Shows notifications in the system’s own place: the Notification Center on macOS,
a toast on Windows and the notification server on Linux, which plain GNOME has
even without a tray. Needs the notifications feature.
use ravenrs_platform_native::SystemNotifier;
let notifier = SystemNotifier::new("Notes").bundle_id("com.example.notes");
std::thread::spawn(move || notifier.send("Saved", "Your notes are safe."));Implementations§
Source§impl SystemNotifier
impl SystemNotifier
Sourcepub fn bundle_id(self, id: impl Into<String>) -> Self
pub fn bundle_id(self, id: impl Into<String>) -> Self
The identifier in the app’s Info.plist. On macOS it says whose the
notifications are; without one the system stops to ask for an app.
Sourcepub fn opens_window(self, id: impl Into<String>) -> Self
pub fn opens_window(self, id: impl Into<String>) -> Self
On Linux, a click on the notification brings back the window of the running
app with this AppIdentity id, if it closes to the tray.
The other systems do not tell of the click.
Trait Implementations§
Source§impl Clone for SystemNotifier
impl Clone for SystemNotifier
Source§fn clone(&self) -> SystemNotifier
fn clone(&self) -> SystemNotifier
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 SystemNotifier
impl RefUnwindSafe for SystemNotifier
impl Send for SystemNotifier
impl Sync for SystemNotifier
impl Unpin for SystemNotifier
impl UnsafeUnpin for SystemNotifier
impl UnwindSafe for SystemNotifier
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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