pub struct Notification {
pub tag: String,
pub title: String,
pub body: String,
pub activation: Option<String>,
pub action: Option<String>,
pub severity: Severity,
pub buttons: Vec<NotificationButton>,
pub silent: bool,
pub app: Option<String>,
pub from: Option<NotificationSender>,
}Fields§
§tag: StringA stable tag: showing the same tag again replaces the earlier one. Keep it to 15 ASCII characters, the shortest limit among the platforms.
title: String§body: String§activation: Option<String>§action: Option<String>§severity: Severity§silent: boolShown without a sound: one asked for so, or a change to one already shown (a download’s progress), which would otherwise sound at every step. macOS plays no sound for any.
app: Option<String>The app it is from, by the name the person knows it by, when no window of that app sent it (a mention the session found in Chat’s messages).
from: Option<NotificationSender>The person or agent it is from: the notification names them and leads with their face, where the platform draws one.
Implementations§
Source§impl Notification
impl Notification
pub fn new( tag: impl Into<String>, title: impl Into<String>, body: impl Into<String>, ) -> Self
Sourcepub fn from_agent(self, name: impl Into<String>, id: impl Into<String>) -> Self
pub fn from_agent(self, name: impl Into<String>, id: impl Into<String>) -> Self
From the agent name, whose stable id is id.
pub fn quietly(self) -> Self
pub fn with_activation(self, uri: impl Into<String>) -> Self
pub fn with_action(self, label: impl Into<String>) -> Self
pub fn with_severity(self, severity: Severity) -> Self
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§impl Debug for Notification
impl Debug for Notification
Source§impl<'de> Deserialize<'de> for Notification
impl<'de> Deserialize<'de> for Notification
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Notification
Source§impl PartialEq for Notification
impl PartialEq for Notification
Source§impl Serialize for Notification
impl Serialize 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 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