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>, ) -> Notification
Sourcepub fn from_app(self, name: &str) -> Notification
pub fn from_app(self, name: &str) -> Notification
From the app called name; a blank name says nothing.
Sourcepub fn from_agent(
self,
name: impl Into<String>,
id: impl Into<String>,
) -> Notification
pub fn from_agent( self, name: impl Into<String>, id: impl Into<String>, ) -> Notification
From the agent name, whose stable id is id.
pub fn quietly(self) -> Notification
pub fn with_activation(self, uri: impl Into<String>) -> Notification
pub fn with_action(self, label: impl Into<String>) -> Notification
pub fn with_severity(self, severity: Severity) -> 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
Source§impl<'de> Deserialize<'de> for Notification
impl<'de> Deserialize<'de> for Notification
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Notification, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Notification, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more