pub struct Notification {
pub id: Option<String>,
pub title: String,
pub body: Option<String>,
}Expand description
A message the platform shows outside the app’s windows (macOS’s Notification Center, GNOME’s and Plasma’s notifications, Windows’ toasts), and keeps in its list until the user clears it.
Fields§
§id: Option<String>Names it: a notification with the same id replaces it, and
withdraw_notification takes it
away. The core gives one to a notification the app didn’t name,
so backends always have one.
title: String§body: Option<String>Implementations§
Source§impl Notification
impl Notification
pub fn new(title: impl Into<String>) -> Notification
Sourcepub fn body(self, body: impl Into<String>) -> Notification
pub fn body(self, body: impl Into<String>) -> Notification
The text under the title.
Sourcepub fn id(self, id: impl Into<String>) -> Notification
pub fn id(self, id: impl Into<String>) -> Notification
Names it, so a later one with the same id replaces it (a download’s progress, a count of unread messages) and the app can withdraw it or tell which one the user clicked.
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§impl Debug for Notification
impl Debug for Notification
impl Eq for Notification
Source§impl PartialEq for Notification
impl PartialEq for Notification
impl StructuralPartialEq for Notification
Auto Trait Implementations§
impl Forget for Notification
impl Freeze for Notification
impl Move for Notification
impl RefUnwindSafe for Notification
impl Send for Notificationwhere
RawVecInner: Send,
impl Sync for Notificationwhere
RawVecInner: Sync,
impl Unpin for Notification
impl UnsafeUnpin for Notification
impl UnwindSafe for Notificationwhere
RawVecInner: 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