pub struct Notification {
pub title: String,
pub body: String,
pub app_name: Option<String>,
pub app_id: Option<String>,
pub level: NotificationLevel,
pub silent: bool,
pub timeout: NotificationTimeout,
pub icon: Option<String>,
}Expand description
平台无关的系统通知。
app_id 在 Windows 上对应 AUMID:打包应用应传入安装时注册的 id,
未注册的 id 可能让通知不显示。app_name 主要用于 Linux 通知中心分组。
Fields§
§title: String§body: String§app_name: Option<String>§app_id: Option<String>§level: NotificationLevel§silent: bool§timeout: NotificationTimeout§icon: Option<String>Linux 图标名/绝对路径;其他平台可忽略。
Implementations§
Source§impl Notification
impl Notification
pub fn new(title: impl Into<String>) -> Self
pub fn with_body(self, body: impl Into<String>) -> Self
pub fn with_app_name(self, name: impl Into<String>) -> Self
pub fn with_app_id(self, id: impl Into<String>) -> Self
pub fn with_level(self, level: NotificationLevel) -> Self
pub fn with_silent(self, silent: bool) -> Self
pub fn with_timeout(self, timeout: NotificationTimeout) -> Self
pub fn with_icon(self, icon: impl Into<String>) -> Self
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