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>) -> Notification
pub fn with_body(self, body: impl Into<String>) -> Notification
pub fn with_app_name(self, name: impl Into<String>) -> Notification
pub fn with_app_id(self, id: impl Into<String>) -> Notification
pub fn with_level(self, level: NotificationLevel) -> Notification
pub fn with_silent(self, silent: bool) -> Notification
pub fn with_timeout(self, timeout: NotificationTimeout) -> Notification
pub fn with_icon(self, icon: impl Into<String>) -> Notification
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
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 moreSource§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 Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnsafeUnpin for Notification
impl UnwindSafe for Notification
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.